{"thread":{"id":"26337","subject":"Is there a specific reason that git gui does not respect comment lines added by a git hook?","startedAt":"2011-01-26T10:14:28Z","lastAt":"2011-01-29T22:45:30Z","messageCount":2,"participants":["Wilbert van Dolleweerd","David Aguilar"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"159885","messageId":"AANLkTingTLM8MCEBdS_4OAE5DU1L4xndRzQMq_gdvKaL@mail.gmail.com","threadId":"26337","inReplyTo":null,"subject":"Is there a specific reason that git gui does not respect comment lines added by a git hook?","fromName":"Wilbert van Dolleweerd","fromEmail":"wilbert@arentheym.com","sentAt":"2011-01-26T10:14:28Z","receivedAt":"2011-01-26T10:14:28Z","isPatch":false,"sender":{"key":"wilbert@arentheym.com","avatar":"https://gravatar.com/avatar/781148004f6b87d06fb292344721b83d353d1ba510c59b4dce9ac3feba78150e?d=mp&s=160"},"body":"Hello,\n\nI've written a prepare-commit-msg hook that maps Team Foundation\nServer workitem ID's to a Git commit message. (When committing, a\npicklist appears. Users can select one or more workitems and the\nworkitems are added to the commit message using a specific format.\nLater on, we use git log --grep to search for specific commits\nbelonging to a workitem).\n\nI'm using comments in the commit message to give additional\ninformation to the user. For example, when the Team Foundation Server\nis not available, I add the following comment to the top of the commit\nmessage.\n\n# Warning: could not access Team Foundation Server at <servername>.\nCheck your configuration or manually enter your workitem.\n\nBecause the line starts with a # sign, it is not added to the actual\ncommit message...when using git commit. If I use git gui, the above\ncomment appears in the git gui interface but *is* actually added to\nthe git commit message when committing.\n\nIs there a specific reason that git gui is actually adding lines\nstarting with a # sign? I was expecting it to ignore those lines.\n\n-- \nKind regards,\n\nWilbert van Dolleweerd\nBlog: http://walkingthestack.wordpress.com/\nTwitter: http://www.twitter.com/wvandolleweerd\n"},{"id":"160037","messageId":"20110129224528.GA7676@gmail.com","threadId":"26337","inReplyTo":"AANLkTingTLM8MCEBdS_4OAE5DU1L4xndRzQMq_gdvKaL@mail.gmail.com","subject":"Re: Is there a specific reason that git gui does not respect comment lines added by a git hook?","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2011-01-29T22:45:30Z","receivedAt":"2011-01-29T22:45:30Z","isPatch":false,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Wed, Jan 26, 2011 at 11:14:28AM +0100, Wilbert van Dolleweerd wrote:\n> Hello,\n> \n> I've written a prepare-commit-msg hook [...snip...]\n> I'm using comments in the commit message to give additional\n> information to the user. For example, when the Team Foundation Server\n> is not available, I add the following comment to the top of the commit\n> message.\n\nI have the impression that you're running into this behavior\nbecause this information is at the top of the commit message\n(line 1).  Users then fill in the actual message on the\nlines below this, I presume?\n\nTry to see what happens if you set it up so that users fill\nin the commit message above the auto-generated comment.\nI have a feeling that it only strips out '#' lines after\nit's read in the commit message proper.\n\nI haven't read the code so I'm not certain of this, but it seems\nlike that is what's going on.  Also, \"git gui\" uses plumbing\ncommands underneath the hood and does not actually call\n\"git commit\" directly.  That might help explain this subtle\ndifference in behavior.\n\n> Because the line starts with a # sign, it is not added to the actual\n> commit message...when using git commit. If I use git gui, the above\n> comment appears in the git gui interface but *is* actually added to\n> the git commit message when committing.\n> \n> Is there a specific reason that git gui is actually adding lines\n> starting with a # sign? I was expecting it to ignore those lines.\n> \n> -- \n> Kind regards,\n> \n> Wilbert van Dolleweerd\n> Blog: http://walkingthestack.wordpress.com/\n> Twitter: http://www.twitter.com/wvandolleweerd\n\n-- \n\n\t\tDavid\n"}]}