diff

Generating content diffs using SequenceMatcher (Python)

I want to generate a diff between to revisions of text (more specifically, Markdown-formatted articles) in Python. I want to format this diff in a manner similar to what Github does. I've looked at difflib and have found that it does what I want. However, the Differ class is too high-level; I would have to parse the diff lines to gener...

How to use one script for diff and diff3 in Subversion?

I have a perl script that determines what external diff to use depending on the file's content. I would like to use it determine external diff3 also. Which is the best method to know how my script is being called? I was planning to catch the last three parameters, and verify if they are all files, to use the diff3 options, but I'm hopi...

How does git-diff generate hunk descriptions?

(git version 1.6.5.7) When I run git diff the output has a nice scope hint after the line numbers for my Python scripts, e.g.: diff --git a/file.py b/file.py index 024f5bb..c3b5c56 100644 --- a/file.py +++ b/file.py @@ -14,6 +14,8 @@ TITF: Test Infrastructure Tags Format ... @@ -1507,13 +1533,16 @@ class Tags( object ): ... Note that...

Show number of changed lines per author in git

i want to see the number of removed/added line, grouped by author for a given branch in git history. there is git shortlog -s which shows me the number of commits per author. is there anything similar to get an overall diffstat? ...

Is it possible to have all "git diff" commands use the "Python diff", in all git projects?

When including the line *.py diff=python in a local .gitattributes file, git diff produces nice labels for the different diff hunks of Python files (with the name of the function where the lines changes are, etc.). Is is possible to ask git to use this diff mode for all Python files across all git projects? I tried to set a global ~...

Need Insight - What is the best practice for syncing up a production database that will be used on a live site? CakePHP, Mysql

I have a site set up using CakePHP and MySQL and I want to work on a test database without disrupting my live site in case something goes wrong. I have another busy site, but my test site runs off the live database which can be occasionally nerve wracking. What do I do if I change a table name in the test db and I want it changed in th...

Ignoring specific differences in diff

When doing recursive diffs I want to ignore expected differences/translations - is there a way to do that with standard unix tools? E.g. file1: 1 ... 2 /path/to/something/ver1/blah/blah 3 /path/to/something/ver1/blah/blah 4 ... file2: 1 ... 2 /path/to/something/ver2/blah/blah 3 /path/to/something/ver3/blah/blah 4 ... I want to be a...

Where can I find the diff algorithm?

Where can I find an explanation and implementation of the diff algorithm? First of all I have to recognize that I'm not sure if this is the correct name of the algorithm. For example, how does Stack Overflow mark the differences between two edits of the same question? PS: I know the C and PHP programming languages. ...

How to diff two regions of the same file in Eclipse

I'm a TDDer and often have a need to refactor out common or similar code. If it is exactly the same there is no big problem, Eclipse can almost always do that by itself. But to get there I'm finding myself often looking at similar, but not identical, code fragments in the same, or even different, files. It would be very handy if there w...

Generic object comparison diff routine

The question stems from database tables comparison. Let's say we put left row in the instance Left and the right one into instance Right of the same type. And we'got many tables and respective types. How to implement more or less generic routine resulting in a collection of diffs e.g. propertyName , leftValue , rightValue for each suc...

Is there a tag in XHTML that you can put anywhere in the body - even inside TABLE elements?

I would like to be able to place an empty tag anywhere in my document as a marker that can be addressed by jQuery. However, it is important that the XHTML still validates. To give you a bit of background as to what I'm doing: I've compared the current and previous versions of a particular document and I'm placing markers in the html whe...

Is there a "Language-Aware" diff?

Possible duplicate: do you know of any language-aware diffing tools? (Appologies for the poor title. I'm open to suggestions for a better one. "Language-gnostic", perhaps?) Does there exist a diff utility (preferably *nix-based) that will diff files based on how a (selectable) language compiler would view the code? For example, t...

Are there any libraries for showing diffs between two web pages?

I am looking for a library in any language--preferably PHP though--that will display the difference between two web pages. The differences can be displayed side-by-side, all in one document, or in any other creative way. Examples of what this would look like: http://1.bp.blogspot.com/_pLC3YDiv_I4/SBZPYQMDsPI/AAAAAAAAADk/wUMxK307jXw/s1...

ftp diff viewer

Anyone know a good viewer for file diffs between an ftp host and a workstation? ...

Can I change the diff tool used in TortoiseHg?

Hi, I use TortoiseHg to commit changes. The diff that is shown in the commit dialog contains a lot of additions/deletions. I configured KDiff3 as external diff tool. When I click on the diff icon in the commit dialog, KDiff3 opens and that comparison is a lot more 'intelligent': it detects 'better' what I changed: I moved a block of co...

How to get change history for a specific file in git repository

I would like to do something like: git history my_file possible output 2010-05-16 + add this line + more code here 2010-05-15 + delete code below - bad code - more bad codd 2010-05-12 + changes made here ...

How to make a NON-LINE based diff between two strings in Java

I have to compare the text content of two xml elements, eg. <p>During lunch he hears strangers whispering, catching the name "Potter" and "Harry", and someone saying You-Know-Who has gone at last. </p> and <p>During dinner he hears strangers whispering, catching the name "Rossi" and "Mario", and someone saying You-Know-Who has gone ...

Mac-native text editor that can syntax-highlight diff files?

I do something like "svn diff > /mystuff/current.diff". I want to view this .diff file with syntax highlighting. jEdit does it, but it's a huge beast and it takes a while to start up. I want something lightweight/native. Smultron/Fraise, TextWrangler, TextEdit, Dashcode don't seem to highlight .diff files. FileMerge seems to want to...

Beyond Compare and Eclipse combined?

I just realized that I've been doing as much coding in Beyond Compare as in my IDE (Eclipse). I'm finding it's very handy to have two copies of my project and to be able to always see the diff between the last known good copy and the working copy. However, BC isn't that great an IDE, it's merely a decent text editor. Eclipse has a Compa...

visually show diff output in a java program

I am currently developing a java program where I need to show the difference between two text. Is there any library available for visually show the difference, that is the diff output in my java program or how can I do so. Any suggestion will be very helpful for me. ...