You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Purple Streak <mr...@googlemail.com> on 2009/09/23 16:36:20 UTC

Pre commit hook being ignored

Hi,
Just come across a wierd one. We have a pre-commit hook that checks
the length of the log message and fails the commit if it's length is
less than 5 characters.  This works when I'm going from the command
line or Tortoise, i.e. checkin with comment of "oops" gets failed.
However I also have AnkhSVN in visual studio and this managed to
commit ok.

This was in the same working copy and I tried a couple more just to
confirm.  This was running against the svn:// protocol, so it would
seem svnserve doesn't run the hook and fail the commit when the
request comes from AnkhSVN.

How can that be?


Purple

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

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: Pre commit hook being ignored

Posted by Purple Streak <mr...@googlemail.com>.
2009/9/24 Purple Streak <mr...@googlemail.com>:
> 2009/9/23 Andrey Repin <an...@freemail.ru>:
>> Greetings, Purple Streak!
>>
>>> This was in the same working copy and I tried a couple more just to
>>> confirm.  This was running against the svn:// protocol, so it would
>>> seem svnserve doesn't run the hook and fail the commit when the
>>> request comes from AnkhSVN.
>>
>>> How can that be?
>>
>> Try much shorter log message. 1 symbol.
>> Ankh probably adding CRLF marks, making log record longer than expected.
>
> As yes - 1 charater does fail.  I'll try what David sugests as well.
> Odd as I'd thought of that and checked the message that had gone in
> and it only looked to be just the 4 characters, so it'll be
> interesting to find out what I get.
>

Yep - Ankh adds an extra newline (LF or CRLF - didn't check which
exactly).  Simple fix in the trigger to remove extra whitespace.
Sorry - should have thought of that myself.  Brain fade...

Cheers,
Purple

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

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: Pre commit hook being ignored

Posted by Purple Streak <mr...@googlemail.com>.
2009/9/23 Andrey Repin <an...@freemail.ru>:
> Greetings, Purple Streak!
>
>> This was in the same working copy and I tried a couple more just to
>> confirm.  This was running against the svn:// protocol, so it would
>> seem svnserve doesn't run the hook and fail the commit when the
>> request comes from AnkhSVN.
>
>> How can that be?
>
> Try much shorter log message. 1 symbol.
> Ankh probably adding CRLF marks, making log record longer than expected.

As yes - 1 charater does fail.  I'll try what David sugests as well.
Odd as I'd thought of that and checked the message that had gone in
and it only looked to be just the 4 characters, so it'll be
interesting to find out what I get.

Cheers,
Purple

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

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: Pre commit hook being ignored

Posted by Andrey Repin <an...@freemail.ru>.
Greetings, Purple Streak!

> This was in the same working copy and I tried a couple more just to
> confirm.  This was running against the svn:// protocol, so it would
> seem svnserve doesn't run the hook and fail the commit when the
> request comes from AnkhSVN.

> How can that be?

Try much shorter log message. 1 symbol.
Ankh probably adding CRLF marks, making log record longer than expected.


--
WBR,
 Andrey Repin (anrdaemon@freemail.ru) 23.09.2009, <20:49>

Sorry for my terrible english...

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

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: Pre commit hook being ignored

Posted by David Weintraub <qa...@gmail.com>.
Try a test. Have the hook report the length of the message, and the message
itself to STDERR. Put angle brackets around the commit message, so you can
make sure there are no spaces at the beginning or end of the message. Then
change the hook to purposefully reject the commit. This way, you'll see the
length of the message and the message itself.

Also make sure that the hook has execute permission.

On Wed, Sep 23, 2009 at 12:36 PM, Purple Streak <
mrpurplestreak@googlemail.com> wrote:

> Hi,
> Just come across a wierd one. We have a pre-commit hook that checks
> the length of the log message and fails the commit if it's length is
> less than 5 characters.  This works when I'm going from the command
> line or Tortoise, i.e. checkin with comment of "oops" gets failed.
> However I also have AnkhSVN in visual studio and this managed to
> commit ok.
>
> This was in the same working copy and I tried a couple more just to
> confirm.  This was running against the svn:// protocol, so it would
> seem svnserve doesn't run the hook and fail the commit when the
> request comes from AnkhSVN.
>
> How can that be?
>
>
> Purple
>
> ------------------------------------------------------
>
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2398977
>
> To unsubscribe from this discussion, e-mail: [
> users-unsubscribe@subversion.tigris.org].
>



-- 
David Weintraub
qazwart@gmail.com

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

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].