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

Re: Enforcing Code Style

From: John Peacock <john.peacock_at_havurah-software.org>
Date: Fri, 22 Aug 2008 09:24:14 -0400

Tom Browder wrote:
> That sounds like a good idea. Am I correct that the script would have
> to be run on the user's host?

No, all hook scripts run on the server; the Subversion project itself
has shied away from client-side scripting (from a security standpoint).
  You are free to make any sort of wrapper around svn that you like, to
run any sort of cleanup and validation you want, but that is something
you need to manage all on your own.

> Couldn't svn diff be defined on the user side to ignore
> white-space-only changes?

You can run an external diff program (like GNU diff) that ignores
whitespace changes but that doesn't help with two things:

1) "blame" relies on which revision changed which line for its display
(which has nothing to do with whether the commit was substantial or just
whitespace);

2) many source-code formatters make non-whitespace changes as well (like
moving braces to the next line).

> Couldn't the script inject a comment somehow?

Comment what? You obvious would note in the commit for the mass
reformat that this was done, but you will have "lost" the immediately
accessible line-oriented history of that file (see below).

>
>> you won't be able to tell who added a feature. If this is acceptable, you
>
> I don't understand why.

Because the first time someone reformats a file, all of those changed
lines are now attributed to that user, rather than whoever added the
lines in the first place. Now, it is possible to use blame with a
specific revision number to go back before the reformat, but it is not
nearly as useful.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-08-22 15:24:46 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.