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

Re: beautify pre-commit

From: Kevin Grover <kevin_at_kevingrover.net>
Date: Sat, 13 Dec 2008 11:33:32 -0800

I believe this is talked about in the manual.

In a nutshell, you can not modify stuff during a commit - so no
reformatting, etc.

What you can do is use a pre-commit hook script that checks files and issues
an error if they do not meet your requirements. If you have a code
formatter that has a check mode and returns and error code, you can run it
and error out (sending the reasons to stderr). If not, you can write a
filter. You process your code files (probably one at a time) to a temp
file, diff them with the original, and then issue error(s) if there are
differences. This causes the commit to fail.

Being so draconian on commits may prove counter productive: sometimes you
just need to get things into the repo, and fix them later: you may want to
limit the checks to stable branch(es) only.

There are most certainly other ways to do this as well.

- Kevin

On Sat, Dec 13, 2008 at 5:12 AM, marc gonzalez-carnicer <
carnicer.lists_at_gmail.com> wrote:

> i have searched on the project links page and on the list archives,
> and i have not found references to pre-commit scripts for enforcing an
> homogeneous (and proper) style of indentation, tabs, spacing, etc.
>
> any other references?
>
> any thoughts on the convenience of doing it and on how to do it?
>
> and what program to use? on ubuntu i find 2 programs, bcpp and
> uncrustify which seem to be somehow the same.
>
> ------------------------------------------------------
>
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=983733
>
> To unsubscribe from this discussion, e-mail: [
> users-unsubscribe_at_subversion.tigris.org].
>

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=983849

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2008-12-13 20:34:23 CET

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.