You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by John Pye <jo...@curioussymbols.com> on 2006/08/04 02:56:29 UTC

svn diff with stripping of code comments

Hi all

Subversion supports calling an external script to perform diffs when
using "svn diff".

I'd like to use this facility to find non-trivial changes in a code
repository where a lot of reformatting and comment changes have been
made. Has anyone got a tool that strips code comments and normalises
whitespace before performing a diff?

I've got a preliminary python script which I'll attach here. It's buggy,
and doesn't play nice with svn, so I'm hoping someone else might have
built something better already.

I use a wrapper script as suggested in
http://svnbook.red-bean.com/en/1.2/svn.advanced.externaldifftools.html
didn't manage to make it work.

Cheers
JP

Re: svn diff with stripping of code comments

Posted by John Pye <jo...@curioussymbols.com>.
This works now, so I'm posting my revised version.

Strangely, on FC4, this script fails intermittently, producing no output
and no errors/exceptions. But when it it works, it works fine. I'd love
to know what the bug is, if anyone can see it.

Usage: svn diff --diff-cmd /path/to/stripdiff -r 950 slv9.c

(Note that you can't use ~ expansion in the path to stripdiff, eg
~/john/stripdiff -- it will fail with error 255)

Cheers
JP

John Pye wrote:

>Hi all
>
>Subversion supports calling an external script to perform diffs when
>using "svn diff".
>
>I'd like to use this facility to find non-trivial changes in a code
>repository where a lot of reformatting and comment changes have been
>made. Has anyone got a tool that strips code comments and normalises
>whitespace before performing a diff?
>
>I've got a preliminary python script which I'll attach here. It's buggy,
>and doesn't play nice with svn, so I'm hoping someone else might have
>built something better already.
>
>I use a wrapper script as suggested in
>http://svnbook.red-bean.com/en/1.2/svn.advanced.externaldifftools.html
>didn't manage to make it work.
>
>Cheers
>JP
>  
>