All of lore.kernel.org
 help / color / mirror / Atom feed
* Is there a specific reason that git gui does not respect comment lines added by a git hook?
@ 2011-01-26 10:14 Wilbert van Dolleweerd
  2011-01-29 22:45 ` David Aguilar
  0 siblings, 1 reply; 2+ messages in thread
From: Wilbert van Dolleweerd @ 2011-01-26 10:14 UTC (permalink / raw)
  To: Git ML

Hello,

I've written a prepare-commit-msg hook that maps Team Foundation
Server workitem ID's to a Git commit message. (When committing, a
picklist appears. Users can select one or more workitems and the
workitems are added to the commit message using a specific format.
Later on, we use git log --grep to search for specific commits
belonging to a workitem).

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.

# Warning: could not access Team Foundation Server at <servername>.
Check your configuration or manually enter your workitem.

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Is there a specific reason that git gui does not respect comment lines added by a git hook?
  2011-01-26 10:14 Is there a specific reason that git gui does not respect comment lines added by a git hook? Wilbert van Dolleweerd
@ 2011-01-29 22:45 ` David Aguilar
  0 siblings, 0 replies; 2+ messages in thread
From: David Aguilar @ 2011-01-29 22:45 UTC (permalink / raw)
  To: Wilbert van Dolleweerd; +Cc: Git ML

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-29 22:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-26 10:14 Is there a specific reason that git gui does not respect comment lines added by a git hook? Wilbert van Dolleweerd
2011-01-29 22:45 ` David Aguilar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.