[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: marc gonzalez-carnicer <carnicer.lists_at_gmail.com>
Date: Mon, 15 Dec 2008 19:02:57 +0100

thanks for your meaningful comments.

about being draconian : it's not that we would like to force it, but
when all the time you get people committing files with different
encoding, spaces at end of line, changing tabs / spaces ...

2008/12/13 Kevin Grover <kevin_at_kevingrover.net>:
> 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=984589

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2008-12-15 19:04:08 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.