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

RE: Post Commit Code Formatting

From: Jake Robb <jakerobb_at_mac.com>
Date: 2005-06-22 23:08:08 CEST

Matthew Janulewicz wrote:

> So calk it up to whatever, but on a purely philosophical note, there is a
> reason that this kind of thing has been discussed in the past (for other
> tools) and shot down. Namely, it's a terrible idea. Altering code,
> especially unbeknownst to the author, once it has been submitted is not
> the MO of any source control tool I've ever seen, and I've used a lot
> of them. It doesn't matter that it's 'just formatting'. The job of a good
> source control tool is to keep impeccable records about the code that has
> been checked in, not a slightly altered version of it. I've worked in some
> regulated industries and if they (SEC, FDA) audit you (and the FDA does
> regularly) and found that you altered code using a script once it was
> checked in, you'd be shut down. Doesn't matter what or why.

Okay, so I've been curiously following this thread, and Matthew is the first
to actually have stated the reasons that this feature gets shot down when it
is requested. (Note that, as I am not directly affected, I did not bother
to go look it up in the archives, which I could have done easily.)

First of all, I'd like to say that I'm impressed at the level of maturity
here -- I can think of hundreds of other forums of discussion where this
would have dissolved into a flame war.

Second, while I understand the reasons given, I'm not sure I agree. Is it
Subversion's job to prevent anyone from engaging in activities which are
forbidden in select industries? Has the Subversion team, at some point,
decided that it would be wrong to provide a means to engage in activities
which the industry at large does not acknowledge as "best practice"?

It seems to me that the Subversion developers have decided to lock a door
for reasons which are primarily non-technical, and it seems to me that those
whose industries do not prohibit automatic code alteration should be allowed
to use that door if they choose to do so.

I am under the impression that a pre-commit hook is not currently permitted
to modify the data being committed. This is the locked door to which I am
referring, and unlocking this door would solve Bernard's issue. Nobody is
forcing anyone else to walk through the unlocked door.

So, I now ask of the Subversion developers: are there *technical* reasons
which would inhibit permitting a pre-commit hook to modify the data being
committed?

Having said all that, put your code formatter in your build script (or in
your IDE), so that it occurs right before compilation. Your developers will
be forced to reckon with any errors caused by the formatter before they can
even test their code locally. I assume that you test before you commit....

-Jake

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Jun 22 23:27:57 2005

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.