Git hooks

Discuss general development subjects that are not specific to a particular version like the versioning control system we use or other infrastructure.
User avatar
ToonArmy
Registered User
Posts: 335
Joined: Fri Mar 26, 2004 7:31 pm
Location: Bristol, UK
Contact:

Re: Git hooks

Post by ToonArmy » Sat Apr 03, 2010 1:22 am

Chris SmithBlogXMOOhlohArea51WikiNo support via PM/IM
Image

User avatar
igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: Git hooks

Post by igorw » Sat Apr 03, 2010 9:03 am

Thanks, however now both stdout and stderr are being output with `php -l`. Actually I believe only stdout is stored in $result and sterr output directly.
PHP Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE in - on line 3
PHP Syntax check failed:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE test.php line 3

User avatar
ToonArmy
Registered User
Posts: 335
Joined: Fri Mar 26, 2004 7:31 pm
Location: Bristol, UK
Contact:

Re: Git hooks

Post by ToonArmy » Sat Apr 03, 2010 11:32 am

eviL3 wrote:Thanks, however now both stdout and stderr are being output with `php -l`. Actually I believe only stdout is stored in $result and sterr output directly.
PHP Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE in - on line 3
PHP Syntax check failed:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE test.php line 3
It doesn't output on stderr for me, how odd. :-/
Chris SmithBlogXMOOhlohArea51WikiNo support via PM/IM
Image

User avatar
igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: Git hooks

Post by igorw » Sat Apr 03, 2010 1:33 pm

Mac OS 10.6.3, PHP 5.3.1, GNU bash 3.2.48, GNU grep 2.5.4.

If it worked properly before I'd suggest reverting.

User avatar
igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: Git hooks

Post by igorw » Sat Apr 03, 2010 7:05 pm

Another thing, are you sure you want all branch names to be added to commit messages? Instead of just (bug|feature) named branches.

User avatar
ToonArmy
Registered User
Posts: 335
Joined: Fri Mar 26, 2004 7:31 pm
Location: Bristol, UK
Contact:

Re: Git hooks

Post by ToonArmy » Sat Apr 03, 2010 7:39 pm

eviL3 wrote:Mac OS 10.6.3, PHP 5.3.1, GNU bash 3.2.48, GNU grep 2.5.4.

If it worked properly before I'd suggest reverting.
Well from what you suggest you get both outputs so if I just send stderr to /dev/null that should be fine.
eviL3 wrote:Another thing, are you sure you want all branch names to be added to commit messages? Instead of just (bug|feature) named branches.
Yup Nils wants the branch prefixed before all commit messages.
Chris SmithBlogXMOOhlohArea51WikiNo support via PM/IM
Image

User avatar
igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: Git hooks

Post by igorw » Sat Apr 03, 2010 7:55 pm

I've added the stderr null redirect. If it works on your end I'll send Nils the pull request.

User avatar
ToonArmy
Registered User
Posts: 335
Joined: Fri Mar 26, 2004 7:31 pm
Location: Bristol, UK
Contact:

Re: Git hooks

Post by ToonArmy » Sat Apr 03, 2010 8:31 pm

eviL3 wrote:I've added the stderr null redirect. If it works on your end I'll send Nils the pull request.
Thumbs up. :)
Chris SmithBlogXMOOhlohArea51WikiNo support via PM/IM
Image

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: Git hooks

Post by Oleg » Sat Apr 10, 2010 9:50 am

One observation I have with the commit message hook is that if one starts the commit (git ci -a) and then quits without making any changes to the commit message, the commit would proceed due to commit message not being empty. Without the hook git would abort the commit.

I made some changes to remove bashisms from precommit hook so that it runs under freebsd's /bin/sh: http://github.com/p/phpbb3/compare/deve ... us...hooks

User avatar
igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: Git hooks

Post by igorw » Sat Apr 10, 2010 12:29 pm

That is true, but I don't see an easy way around it. The current approach gives you full control over the commit message but also forces you to remove it if you want to abort the commit. Suggestions welcome.

Does freebsd not support bash? Or to put it differently, are there many platforms that do not support bash?

Could you perhaps rename your branch to git-tools, so we have some consistency? I'm just saying this because Chris (ToonArmy) also has a "hooks" branch which serves a completely different purpose.

Post Reply