[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Revert only whitespace changes

From: Konstantin Kolinko <knst.kolinko_at_gmail.com>
Date: Tue, 14 Jun 2011 15:37:33 +0400

2011/6/14 Markus Schaber <m.schaber_at_3s-software.com>:
>
> While Subversion and TortoiseSVN offer the possibility to ignore those
> white space changes when diffing the files, a commit still includes
> those changes, and thus the diff in the SVN history is cluttered, which
> causes problems for reviewers.
>

Maybe you can fine-tune the tools that are being used for the review?

If you are talking about commit e-mails, the script that generates
them can use svn diff option to ignore whitespace changes.

If you are talking about some web software, the viewvc instance used
at ASF ignores whitespace changes when I select "Colored Diff"
command. E.g. [1]

 [1]: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c?r1=649041&r2=649040&pathrev=649041&diff_format=h

>
> Is there any tool which reverts all those whitespace-only changes,
> keeping only the "real" changes in the file?
>

I think that you can generate two diffs, one with all the changes and
second one with non-whitespace ones.

Then, use the first diff to undo the changes and the second one to reapply them.

>
> (I know that a project-wide style guide and rejecting commits which do
> not conform to that style guide are the long term solution to that
> problem, and we're aiming towards that.)
>

A good policy is to educate the developers to commit whitespace-only
changes in a separate commit.

Best regards,
Konstantin Kolinko
Received on 2011-06-14 13:38:08 CEST

This is an archived mail posted to the Subversion Users mailing list.