diff

Diff multiple versions of a project

这一生的挚爱 提交于 2019-12-24 08:29:41
问题 I've recently started a new job where I have taken over developing an existing system. The system (PHP site if it matters) was setup with three instances. Live site (Used by staff and customers) Test site (Mainly used to demonstrate feature requests to staff) Dev site (Used by the previous developer) This seemed like a reasonable thing to do (They didn't have a SVN server setup). But now that I'm a couple weeks in, I've noticed that the code (and database schemas) is different across all

ignore certain *lines* when merging files

我怕爱的太早我们不能终老 提交于 2019-12-24 08:14:15
问题 I have a repository with two branches, A and B . They are meant to be the same code, but aimed at different versions of the libraries they depend on. So A/file1.js might have a snippet in it like so: this.actor.bar(); whilst B/file1.js might have: // `bar` had its name changed to `foo` in version X.Y of library Z this.actor.foo(); Then I go along into A say and make a whole bunch of changes that are compatible with both versions of library Z and want to merge them into B . Is there any way I

Unix - Compare two directories recursively, output differences as a list minus directories

只谈情不闲聊 提交于 2019-12-24 06:40:32
问题 I have an archive system that archives any file (and the corresponding directory structure of where that file is located) to another volume. It ignores empty directories. After the archive has created a copy to an external volume, I've been using the following command to list the differences to make sure that no file has been missed: diff -qr dir1(original) dir2(archive) My problem is that all of the empty directories that the archive system ignores show up and clog the resulting list. Is

Correct way to do a migrations diff

拥有回忆 提交于 2019-12-24 06:22:59
问题 I'm trying to perform a migrations diff between the schema yaml file and my database, using the following code $migration = new Doctrine_Migration($migrationsPath); $diff = new Doctrine_Migration_Diff(null, $yamlSchemaPath, $migration); $changes = $diff->generateMigrationClasses(); $numChanges = count($changes, true) - count($changes); From what I gather, $from = null here would imply that the from in comparison will be read from the database, but that does not seem to be the case. Reading

PHP class for parsing diffs

断了今生、忘了曾经 提交于 2019-12-24 02:44:23
问题 I am writing a PHP script that needs to interpret Diff files as created by Git. How should I proceed if I want to parse the Diff file and basically print it in a completely different format? I have come across the Text_Diff PEAR library, but that one only creates the Diffs itself. Or rather, it only takes two different files as input. Is there a way to use that set of classes to achieve what I want (feed in a diff and get a tokenized diff as output, basically split up into the operations)?

Patching nant 0.91 to use mono 4.0

荒凉一梦 提交于 2019-12-24 02:18:20
问题 The Nant doesn't support mono 4, but fortunately there's a patch for it. I download the patch - http://sourceforge.net/tracker/download.php?group_id=31650&atid=402870&file_id=404197&aid=3206199 I also download the source. I unzip the source and copy the patch inside the directory. I run patch < mono-4.0.diff , but I got this error. can't find file to patch at input line 8 Perhaps you should have used the -p or --strip option? The text leading up to this was: |Index: src/NAnt.Core/Functions

Can I check that the diff between two versions of a file solely contains a new prefix that I've added?

南楼画角 提交于 2019-12-24 01:32:06
问题 Background As part work to abstract a few classes to one interface, I've had to changes a file which makes use of one of these old classes to now point it to the interface fields. The file previously would have looked something like this (simplified for example). public class Foo{ public string RetrieveValue(MyModel model) { return model.Area.Street.Flat; } public string RetrieveOtherValue(MyModel model) { return model.Area.Shop; } } But would now look like this. public class Foo{ public

Using diff to find the portions of many files that are the same? (bizzaro-diff, or inverse-diff)

依然范特西╮ 提交于 2019-12-23 23:02:59
问题 Bizzaro-Diff!!! Is there a away to do a bizzaro/inverse-diff that only displays the portions of a group of files that are the same? (I.E. way more than three files) Odd question, I know...but I'm converting someone's ancient static pages to something a little more manageable. 回答1: You want a clone detector. It detects similar code chunks across large source systems. See our ClonedR tool: http://www.semdesigns.com/Products/Clone/index.html 回答2: You could try the comm command (for common ). It

How to apply a patchfile such that it creates new files if needed?

☆樱花仙子☆ 提交于 2019-12-23 20:16:34
问题 I have a set of patch files, which include newly created files. Is there a way to tell patch to create those files or do I have to touch each one manually? 回答1: patch will create new files if they were created in the patch file. 来源: https://stackoverflow.com/questions/3377873/how-to-apply-a-patchfile-such-that-it-creates-new-files-if-needed

How to use diff and patch in Cygwin on Windows?

徘徊边缘 提交于 2019-12-23 18:22:55
问题 I follow many articles out there but I still don't know how to use diff and patch in Cygwin Here I create 2 files in Windows Explorer origin.txt one two three new.txt one four five Then I diff -u origin.txt new.txt > file.patch which results this --- origin.txt 2013-03-21 15:53:20.062956800 +0700 +++ new.txt 2013-03-21 15:53:29.191869600 +0700 @@ -1,3 +1,3 @@ one -two -three \ No newline at end of file +four +five \ No newline at end of file Then I patch origin.txt < file.patch which show