In order to verify the code after changing the existing source file, we look only at the lines of code that have been changed in these source files.
After I make changes to the source files in the repository, I have to transfer the lines of code that have been changed in the source file before we do our peer-to-peer reviews.
I can see the visual diff using WinMerge, and I'm happy with what it does for me, but the only requirement for my employees is just to know the file name and line numbers that need to be reviewed,
Is there a way to get only line numbers of a modified file? File types will be text source files such as Javascript, Java, XML, XSL, etc.
Sample Files -
foo (new version):
a b c d e f g h i j k
foo (old version):
a b C d h i k
The result I'm looking for:
foo: 3, 5-7, 10-11
OR
foo: 3 5-7 10-11
I am sure some programs allow this. I just can't find it. Any suggestions? I am currently using WinMerge, but any program that runs on Windows will be fine with me. It would be preferable if the software is open source or free.
EDIT: GNU DiffUtils is close to what I want, but does not exactly match my needs. Looking at the command line options, I see "-q" (or "--brief") as a simplified diff, but it's too simple. Output:
C:\Program Files\GnuWin32\bin>diff.exe -q foo1.txt foo2.txt Files foo1.txt and foo2.txt differ
Normal output:
C:\Program Files\GnuWin32\bin>diff.exe foo1.txt foo2.txt 3c3 < c --- > C 5,7d4 < e < f < g 10,11c7 < j < k --- > k \ No newline at end of file
diff -u output:
C:\Program Files\GnuWin32\bin>diff.exe -u foo1.txt foo2.txt --- foo1.txt 2010-11-09 15:47:12.447916000 -0600 +++ foo2.txt 2010-11-09 15:47:36.129954700 -0600 @@ -1,11 +1,7 @@ a b - c + C d - e - f - g h i - j - k + k \ No newline at end of file
I am looking for something more informative than diff -q, but less informative than diff -u and diff. Any different ninjas who know different options to solve this?
I will always compare a new, recently modified file with an older one. I need only those things that need to be viewed in a new file.