diff

How to understand if the static part of the text has been changed? (diff algorithm related)

First of all this is tough thing to solve, so far I didn't come up with a good example but I hope someone here will figure this out. I hope there is known way to solve these kind of problems, or an obscure algorithm. Scenario: In my application I do several requests to the very same webpage Webpage has dynamic and random content in it...

python dict update diff

Does python have any sort of built in functionality of notifying what dictionary elements changed upon dict update? For example I am looking for some functionality like this: >>> a = {'a':'hamburger', 'b':'fries', 'c':'coke'} >>> b = {'b':'fries', 'c':'pepsi', 'd':'ice cream'} >>> a.diff(b) {'c':'pepsi', 'd':'ice cream'} >>> a.update(b...

Fastest way/algorithm to find one different keyword between two set of text files

I've got 4 text files, 2 of them contains a keyword which other 2 text files don't. What's the fastest way/algorithm to find this "keyword" shared in the first 2 text files but don't exist in the other 2 files? I can think of really slow ways such as go word by word and then search with IndexOf etc. But sounds like it's going to be r...

Diff on Java class signatures?

Given two JAR files for the same Java library, is there a tool that will do a diff of the method signatures between the two jar files? ...

svn diff a specific line in a file

I'd like to determine the last time a specific line was changed in an SVN-versioned file. Does SVN (or TortoiseSVN) have a command to do this? I could write a script that would svn diff each successive revision backwards from HEAD, and check if the line at a given line number was different. But this simplistic approach will not work if,...

How to do text DIFF using PHP?

What is the best way to do this for PHP? Is there any PHP function that can do this, considering the column content could be very large? If PHP function is not available, what shell utility can I call? thanks ...

How do you make git diff use gitx --diff on OS X

Gitx has a great diff viewer, how do I make git automatically pipe git diff whatever into gitx? I've tried to set git config diff.external to a shell script that looks like this: git diff "$2" "$5" | gitx However, that only opens all the individual files up into multiple gitx windows, and it really messes up the files names (changes ...

semantic markup for Python's difflib.HtmlDiff

It appears Python's difflib.HtmlDiff, rather than using INS and DEL, uses SPAN elements with custom classes: python -c 'import difflib; txt1 = "lorem ipsum\ndolor sit amet".splitlines(); txt2 = "lorem foo isum\ndolor amet".splitlines(); d = difflib.HtmlDiff(); print d.make_table(txt1, txt2)' Before I go about fixing this myself, has a...

how to show lines in common (reverse diff)?

I have a series of text files for which I'd like to know the lines in common rather than the lines which are different between them. Command line unix or windows is fine. foo: linux-vdso.so.1 => (0x00007fffccffe000) libvlc.so.2 => /usr/lib/libvlc.so.2 (0x00007f0dc4b0b000) libvlccore.so.0 => /usr/lib/libvlccore.so.0 (0x00007f0dc483f000...

How do I compare the number of lines of code in one version of a project to another?

More specifically, I'm looking for how to count the number of lines in all files within a directory recursively through all directories. I can simply repeat on each the two different versions of the project to get a comparison figure. Alternatively, since subversion has a fairly robust diff functionality, is it possible to mutate a dif...

Can I see changes before I save my file in Vim?

I use Vim. I open a file. I edit it and I want to see what I've edited before I save it. How can I do this in Vim? ...

Compare text of two methods

Is there a tool that can do a diff of two methods? I'm working on some legacy code that has several 100-200 line methods that contain a lot of duplication and I would like to abstract the duplication out. Being able to diff the two methods would be a huge help. In case it matters, I'm working with .NET and Visual Studio 2008. ...

VIM - Show the diff of last saved version and current unsaved version

Duplicate: Can I see changes before save my file in Vim? Is there a way to see the diff of the saved version and the edited version of the same file in VIM? This is the scenario: I've opened a file, editing something and I went away from the computer due to some work. After sometime I returned back and I forgot what I was editing a...

How to get diff to report summary of new, changed and deleted lines

I want to have summary of difference between two files. Expected output is count of new, deleted and changed lines. Does diff readily provides such output? If not is there any script/utility available which helps in getting the summary. ...

Tool to do line content only compares

I'm working on a a tool to generate TSV files for import into a database using bcp.exe and I'd like to validate my output. I can do this by comparing the file I generate to the files produced by exporting using bcp from an existing database. My problem is that the ordering can sometimes be different between files. I'd like a tool that wi...

Can I force git diff to treat a file as a copy?

The diff functionality in git has "copy detection"--if it detects that a new file is actually a (possibly modified) copy of an existing file, the diff output shows the differences between the source file and the new file rather than just a bunch of additions from a blank file to the new file. As far as I can tell, git diff uses some heu...

How do I "diff" multiple files against a single base file?

I have a configuration file that I consider to be my "base" configuration. I'd like to compare up to 10 other configuration files against that single base file. I'm looking for a report where each file is compared against the base file. I've been looking at diff and sdiff, but they don't completely offer what I am looking for. I've con...

Python difflib: highlighting differences inline?

When comparing similar lines, I want to highlight the differences on the same line: a) lorem ipsum dolor sit amet b) lorem foo ipsum dolor amet lorem <ins>foo</ins> ipsum dolor <del>sit</del> amet While difflib.HtmlDiff appears to do this sort of inline highlighting, it produces very verbose markup. Unfortunately, I have not been ab...

How do I compare two source trees in Linux?

I have two directories containing source files to a project I've inherited with little by way of documentation. How do I compare both directories to make see what the differences are. Thanks. ...

Subversion: Generate a full diff from every checkin that includes username

I have a professor that doesn't understand source control very well. He asked us to use comments to determine who wrote each line of code. Most of the class is using email as version control and Visual C++ as the language which leads to a mess of comments, carets and generated code. My group is using subversion and C# and I would prefer ...