threads / discuss / 11651

git gui and commit-msg hook

Subject: git gui and commit-msg hook

## tl;dr

5 messages between Jan 16, 2008 and Jan 21, 2008.

replies: 4people: 3as markdown or json

Blucher, Guy· Jan 16, 2008, 23:13 UTC · lore
Hi,

Is the commit-msg hook supposed to work when using git gui to do a commit?

I've just setup a commit-msg hook in my local repository. It works as advertised from the command-line when using git commit, but if I use git gui to do the commit, then the hook is ignored.

I also have a pre-commit hook in my repository which runs fine when using 'git gui' or 'git commit'.

All I want to do is verify that the text of a commit message follows some "corporate standard", perhaps I can do this using the pre-commit hook instead, but commit-msg seems to be the best fit?

Regards, Guy.

IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914.  If you have received this email in error, you are requested to contact the sender and delete the email.
Shawn O. Pearce· Jan 18, 2008, 04:12 UTC · re: Blucher, Guy · lore

Re: git gui and commit-msg hook

"Blucher, Guy" <Guy.Blucher@dsto.defence.gov.au> wrote:
> Is the commit-msg hook supposed to work when using git gui to do a
> commit?
Uhhh.  Whoops.  ;-)
git-gui doesn't implement the commit-msg hook.  Because I forgot
to implement it.  So yes, its supposed to work, but no, it doesn't,
because it was never coded.  :-)
 
> All I want to do is verify that the text of a commit message follows
> some "corporate standard", perhaps I can do this using the pre-commit
> hook instead, but commit-msg seems to be the best fit?  

Yes, commit-msg is the proper hook to use here. But git-gui doesn't honor it. I'll try to work out a fix after dinner this evening.

Thanks for the bug report.  Definately appreciated.
-- 
Shawn.
Shawn O. Pearce· Jan 21, 2008, 04:08 UTC · re: Blucher, Guy · lore

Re: git gui and commit-msg hook

"Blucher, Guy" <Guy.Blucher@dsto.defence.gov.au> wrote:
> I've just setup a commit-msg hook in my local repository.  It works as
> advertised from the command-line when using git commit, but if I use git
> gui to do the commit, then the hook is ignored.
Fixed in my latest git-gui master, which will be gitgui-0.9.2 or .3.

I apparently missed git 1.5.4-rc4, but will have to ask Junio nicely if this can be included into 1.5.4 final.

-- 
Shawn.
Junio C Hamano· Jan 21, 2008, 04:32 UTC · re: Shawn O. Pearce · lore

Re: git gui and commit-msg hook

"Shawn O. Pearce" <spearce@spearce.org> writes:
Show 9 quoted lines
> "Blucher, Guy" <Guy.Blucher@dsto.defence.gov.au> wrote:
>> I've just setup a commit-msg hook in my local repository.  It works as
>> advertised from the command-line when using git commit, but if I use git
>> gui to do the commit, then the hook is ignored.
>
> Fixed in my latest git-gui master, which will be gitgui-0.9.2 or .3.
>
> I apparently missed git 1.5.4-rc4, but will have to ask Junio nicely
> if this can be included into 1.5.4 final.

Absolutely. That's a consistency-and-usability bugfix, isn't it?

Shawn O. Pearce· Jan 21, 2008, 04:39 UTC · re: Junio C Hamano · lore

Re: git gui and commit-msg hook

Junio C Hamano <gitster@pobox.com> wrote:
Show 14 quoted lines
> "Shawn O. Pearce" <spearce@spearce.org> writes:
> 
> > "Blucher, Guy" <Guy.Blucher@dsto.defence.gov.au> wrote:
> >> I've just setup a commit-msg hook in my local repository.  It works as
> >> advertised from the command-line when using git commit, but if I use git
> >> gui to do the commit, then the hook is ignored.
> >
> > Fixed in my latest git-gui master, which will be gitgui-0.9.2 or .3.
> >
> > I apparently missed git 1.5.4-rc4, but will have to ask Junio nicely
> > if this can be included into 1.5.4 final.
> 
> Absolutely.  That's a consistency-and-usability bugfix, isn't
> it?

I consider it a bug fix for git-gui, but some may say its a new feature since git-gui didn't have a commit-msg hook before this change. :)

Anyway, its now published on repo.or.cz if you want to include it into your next published git.git master to try and get it some more testing before 1.5.4 goes final.

I'm pretty happy with what's in my master right now. I'm actually tempted to tag it gitgui-0.9.2 and say that's the final version we're including in 1.5.4.

-- 
Shawn.

← back to recent threads