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

Re: Beautify code thru a hook

From: Garrett Rooney <rooneg_at_electricjellyfish.net>
Date: 2003-05-09 15:28:40 CEST

Jean-Luc Wasmer wrote:

>Hi,
>
>I checked the SVN book (specially the section about the hooks) but I can't
>find how to do this.
>
>How can I filter committed files thru a code beautifier (like astyle)?
>

right now you can't. if a pre-commit hook script alters the transaction
(meaning: changes the stuff that's being committed) there is no way to
propogate those changes back the the client doing the commit. you can
end up with the client and the server having different ideas of what the
new revision should contain, which breaks things. i think it's a
documented "don't do this" thing at this point. there's some debate
over whether this should be 'fixed', since the idea that doing 'svn
commit' can change the contents of your working copy is kind of scary.

what you could do is have a pre-commit hook that verifies that the code
being checked in conforms to the style guidelines, and if it doesn't
refuse to proceed with the commit. i don't know of anyone who's done
this, but it shouldn't be that hard.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri May 9 15:29:32 2003

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

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