user945620
user945620

Reputation:

How to tell svn's diff to ignore differences in space/tab indentation?

Svn diffs are used in a tool called Cornerstone that lets people do quick and dirty code reviews by looking at what's changed. Unfortunately though, if multiple developers use different indentation schemes, e.g. one person is using vi and another is using emacs and another is using a beautifier program, svn's diffing can go haywire and show each person's indentation as a real/functional difference when it's not.

So... how to tell svn to diff things smartly rather than showing every 1-space difference as significant difference?

Thanks.

Upvotes: 10

Views: 7134

Answers (1)

borrible
borrible

Reputation: 17376

Use -x -w as parameters, e.g.

svn diff -x -w myfile

The -x is followed by arguments passed to the diff program and, for the default diff used by svn -w means ignore all whitespace.

Upvotes: 21

Related Questions