Subject: Re: Is there a specific reason that git gui does not respect comment lines added by a git hook?

From: David Aguilar <[email-masked]>
Date: Sat, 29 Jan 2011 14:45:30 -0800

On Wed, Jan 26, 2011 at 11:14:28AM +0100, Wilbert van Dolleweerd wrote:
> Hello,
> 
> I've written a prepare-commit-msg hook [...snip...]
> I'm using comments in the commit message to give additional
> information to the user. For example, when the Team Foundation Server
> is not available, I add the following comment to the top of the commit
> message.

I have the impression that you're running into this behavior
because this information is at the top of the commit message
(line 1).  Users then fill in the actual message on the
lines below this, I presume?

Try to see what happens if you set it up so that users fill
in the commit message above the auto-generated comment.
I have a feeling that it only strips out '#' lines after
it's read in the commit message proper.

I haven't read the code so I'm not certain of this, but it seems
like that is what's going on.  Also, "git gui" uses plumbing
commands underneath the hood and does not actually call
"git commit" directly.  That might help explain this subtle
difference in behavior.

> Because the line starts with a # sign, it is not added to the actual
> commit message...when using git commit. If I use git gui, the above
> comment appears in the git gui interface but *is* actually added to
> the git commit message when committing.
> 
> Is there a specific reason that git gui is actually adding lines
> starting with a # sign? I was expecting it to ignore those lines.
> 
> -- 
> Kind regards,
> 
> Wilbert van Dolleweerd
> Blog: http://walkingthestack.wordpress.com/
> Twitter: http://www.twitter.com/wvandolleweerd

-- 

		David