how to make svn diff show only non-whitespace line changes between two revisions

SvnDiffWhitespace

Svn Problem Overview


I can get diffs between two revisions using something like

svn diff -r 100:200 > file.diff

But the problem is that there are many lines that show up due to change in whitespace. Is there a way to only write those lines that actually change in a significant way and not just in whitespace?

Svn Solutions


Solution 1 - Svn

You can use

svn diff -r 100:200 -x -b > file.diff

If you want to ignore all whitespaces:

svn diff -x -w | less

Source

Solution 2 - Svn

Use -x --ignore-space-change or -x --ignore-all-space. (See svn -h diff.)

Solution 3 - Svn

You can use an alternate diff command using the --diff-cmd argument for svn diff. diff is a good utility that has plenty of features for ignoring whitespace.

For example:

svn diff --diff-cmd /usr/bin/diff -x "-w"

Solution 4 - Svn

Note that end-of-lines are not considered whitespace in this scenario and that has to be ignored with:

svn diff -x --ignore-eol-style [etc...]

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionumarView Question on Stackoverflow
Solution 1 - SvnjrbjazzView Answer on Stackoverflow
Solution 2 - Svnur.View Answer on Stackoverflow
Solution 3 - SvntschaibleView Answer on Stackoverflow
Solution 4 - SvnzzxyzView Answer on Stackoverflow