Diff tool which can ignore comments/exclude revisions?
I'm looking for an SVN diff tool which can ignore comments as changes, as well as exclude spec开发者_开发技巧ific revision diffs for easier file comparison. For example, see below.
Version 1.
This is a sentence
Here is an address
What's going on here
Version 2.
1 This is a sentence
2 Here is an address
3 What's going on here
Version 3.
//added periods
1 This is a sentence.
2 Here is an address.
3 What's going on here.
Is there a diff tool for windows which can look at version 1, exclude 2, and 3, and produce a visual diff that shows only the periods? I've been working with simple mass refactoring, and it really clouds the forest from the trees.
Scootersoft's "Beyond Compare" will allow you to exclude the comments easily enough - the Pro version allows for custom regex rules to define what should and shouldn't be considered a change - I've not used this functionality but it might help you getting a clear picture of the changes you want to see whilst excluding the noise. I'm not sure about ignoring changes made in particular revisions - you'd typically compare revision X to revision Y, or if you're me revision (n - 1) to revision n.
You can also use the -I option of GNU diff.
-I RE --ignore-matching-lines=RE Ignore changes whose lines all match RE.
So, to ignore the comments, how about diff x y -I '^//'
精彩评论