Svn diff whitespace / tab only changes

Is there a way in svn diff or any other tool (linux based) to show only changes to spaces / tabs ?

Appointment, I do not want these differences to be verified. I can return these lines to the same state before checking if the tool can catch these differences.

Thanks,

+4
source share
3 answers

This should work for you.

#!/bin/bash FILES=`svn status | awk '{ print $2}'` for file in $FILES do COUNT=`svn diff $file --diff-cmd 'diff' -x '-w' | wc -l` if [ $COUNT -le 2 ] then echo "$file has only whitespace changes" fi done 

Also, instead of returning the strings to the same state, why not just return these files?

+5
source

A couple of improvements for the @mfisch script: only works with text-modified files and supports filenames with spaces.

 #!/bin/bash svn status | grep ^M | sed 's/^........//' | while read -r file do COUNT=$(svn diff "$file" --diff-cmd 'diff' -x '-w' | wc -l) if [ $COUNT -le 2 ] then echo "$file has only whitespace changes" # svn revert "$file" fi done 
+2
source

Beyond Compare will display those that are highlighted in a different color depending on the type of file. they really have a version of Linux, but I havenโ€™t used it. This is a great comparison tool.

0
source

All Articles