Compare files and return only the differences using Notepad++

To substract two files in notepad++ (file1 – file2) you may follow this procedure: Recommended: If possible, remove duplicates on both files, specially if the files are big. To do this: Edit => Line operations => Sort Lines Lexicographically Ascending (do it on both files) Add —————————- as a footer on file1 (add at least … Read more

Including new files in SVN diff

To make svn diff include all the unversioned files from your local working copy you have to add these files first. svn diff outputs the same changeset that svn commit would use. If you know for sure that all unversioned files should be added here’s what you could do. Prepare a list of unversioned files … Read more

SVN: Create a diff for lots of revisions

One possible procedure would be to do this: Create diffs for 224453 and 224462 (e.g. by svn diff -r 224452:224463 > diff1.patch). Check out 224446 (svn up -r224446) Apply the diffs (e.g. patch -p0 -i diff1.patch) Create a diff of that against 224445 (svn diff -r 224445 > diff2.patch)

Where does the excerpt in the git diff hunk header come from?

Is there a way to customize it? The configuration is defined in .gitattributes, section “Defining a custom hunk-header”: First, in .gitattributes, you would assign the diff attribute for paths. *.tex diff=tex Then, you would define a “diff.tex.xfuncname” configuration to specify a regular expression that matches a line that you would want to appear as the … Read more

How do I see the differences between 2 MySQL dumps?

run mysqldump with “–skip-opt” to get the 2 dumps files i.e: mysqldump –skip-opt -u $MY_USER -p$MY_PASS mydb1 > /tmp/dump1.sql mysqldump –skip-opt -u $MY_USER -p$MY_PASS mydb2 > /tmp/dump2.sql compare using these diff options: diff -y –suppress-common-lines /tmp/dump1 /tmp/dump2

Python difflib: highlighting differences inline?

For your simple example: import difflib def show_diff(seqm): “””Unify operations between two compared strings seqm is a difflib.SequenceMatcher instance whose a & b are strings””” output= [] for opcode, a0, a1, b0, b1 in seqm.get_opcodes(): if opcode == ‘equal’: output.append(seqm.a[a0:a1]) elif opcode == ‘insert’: output.append(“<ins>” + seqm.b[b0:b1] + “</ins>”) elif opcode == ‘delete’: output.append(“<del>” + … Read more