{"thread":{"id":"34342","subject":"git gui replaces amend message when prepare-commit-msg hook is used","startedAt":"2013-07-04T09:47:28Z","lastAt":"2013-07-05T19:13:42Z","messageCount":12,"participants":["Orgad Shaneh","Fredrik Gustafsson","John Keeping","Antoine Pelisse"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"222536","messageId":"CAGHpTBKOX8G1PZqE2njQ1UbFJeC_L6WxjnTC5NyT8LSbiBNGXw@mail.gmail.com","threadId":"34342","inReplyTo":null,"subject":"git gui replaces amend message when prepare-commit-msg hook is used","fromName":"Orgad Shaneh","fromEmail":"orgads@gmail.com","sentAt":"2013-07-04T09:47:28Z","receivedAt":"2013-07-04T09:47:28Z","isPatch":false,"sender":{"key":"orgads@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1246544?v=4"},"body":"Hi,\n\nIf a prepare-commit-msg hook is used, git gui executes it for \"New Commit\".\n\nIf the \"New Commit\" is selected, and then immediately \"Amend\" (before\nthe hook returns), when the hook returns the message is replaced with\nthe one produced by the hook.\n\n- Orgad\n"},{"id":"222538","messageId":"20130704100112.GD17597@paksenarrion.iveqy.com","threadId":"34342","inReplyTo":"CAGHpTBKOX8G1PZqE2njQ1UbFJeC_L6WxjnTC5NyT8LSbiBNGXw@mail.gmail.com","subject":"Re: git gui replaces amend message when prepare-commit-msg hook is used","fromName":"Fredrik Gustafsson","fromEmail":"iveqy@iveqy.com","sentAt":"2013-07-04T10:01:12Z","receivedAt":"2013-07-04T10:01:12Z","isPatch":false,"sender":{"key":"iveqy@iveqy.com","avatar":"https://avatars.githubusercontent.com/u/761743?v=4"},"body":"On Thu, Jul 04, 2013 at 12:47:28PM +0300, Orgad Shaneh wrote:\n> If a prepare-commit-msg hook is used, git gui executes it for \"New Commit\".\n> \n> If the \"New Commit\" is selected, and then immediately \"Amend\" (before\n> the hook returns), when the hook returns the message is replaced with\n> the one produced by the hook.\n\nI don't get it. The message from the hook is replaced with the message\nfrom the hook?\n\nWhat I don't get is how you can amend to a commit that doesn't yet\nexists. How is that possible?\n\n-- \nMed vänliga hälsningar\nFredrik Gustafsson\n\ntel: 0733-608274\ne-post: iveqy@iveqy.com\n"},{"id":"222539","messageId":"CAGHpTBJqVazwuNxe1m8ggcCPh9d+9Dkuv32aCqU15AZoamGwag@mail.gmail.com","threadId":"34342","inReplyTo":"20130704100112.GD17597@paksenarrion.iveqy.com","subject":"Re: git gui replaces amend message when prepare-commit-msg hook is used","fromName":"Orgad Shaneh","fromEmail":"orgads@gmail.com","sentAt":"2013-07-04T10:03:31Z","receivedAt":"2013-07-04T10:03:31Z","isPatch":false,"sender":{"key":"orgads@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1246544?v=4"},"body":"On Thu, Jul 4, 2013 at 1:01 PM, Fredrik Gustafsson <iveqy@iveqy.com> wrote:\n> On Thu, Jul 04, 2013 at 12:47:28PM +0300, Orgad Shaneh wrote:\n>> If a prepare-commit-msg hook is used, git gui executes it for \"New Commit\".\n>>\n>> If the \"New Commit\" is selected, and then immediately \"Amend\" (before\n>> the hook returns), when the hook returns the message is replaced with\n>> the one produced by the hook.\n>\n> I don't get it. The message from the hook is replaced with the message\n> from the hook?\n>\n> What I don't get is how you can amend to a commit that doesn't yet\n> exists. How is that possible?\n>\n> --\n> Med vänliga hälsningar\n> Fredrik Gustafsson\n>\n> tel: 0733-608274\n> e-post: iveqy@iveqy.com\n\nDid I say anything about a commit that doesn't exist? I have a commit\nwhich I want to amend. If I click the Amend button before the hook is\ndone, this commit's message is replaced (in the editor, not the actual\ncommit) with the hook's result.\n\nThe message that should appear in the editor should come from the\namended commit, not from the hook.\n\n- Orgad\n"},{"id":"222540","messageId":"20130704102104.GE17597@paksenarrion.iveqy.com","threadId":"34342","inReplyTo":"CAGHpTBJqVazwuNxe1m8ggcCPh9d+9Dkuv32aCqU15AZoamGwag@mail.gmail.com","subject":"Re: git gui replaces amend message when prepare-commit-msg hook is used","fromName":"Fredrik Gustafsson","fromEmail":"iveqy@iveqy.com","sentAt":"2013-07-04T10:21:04Z","receivedAt":"2013-07-04T10:21:04Z","isPatch":false,"sender":{"key":"iveqy@iveqy.com","avatar":"https://avatars.githubusercontent.com/u/761743?v=4"},"body":"On Thu, Jul 04, 2013 at 01:03:31PM +0300, Orgad Shaneh wrote:\n> On Thu, Jul 4, 2013 at 1:01 PM, Fredrik Gustafsson <iveqy@iveqy.com> wrote:\n> > On Thu, Jul 04, 2013 at 12:47:28PM +0300, Orgad Shaneh wrote:\n> >> If a prepare-commit-msg hook is used, git gui executes it for \"New Commit\".\n> >>\n> >> If the \"New Commit\" is selected, and then immediately \"Amend\" (before\n> >> the hook returns), when the hook returns the message is replaced with\n> >> the one produced by the hook.\n> >\n> > I don't get it. The message from the hook is replaced with the message\n> > from the hook?\n> >\n> > What I don't get is how you can amend to a commit that doesn't yet\n> > exists. How is that possible?\n> \n> Did I say anything about a commit that doesn't exist? I have a commit\n> which I want to amend. If I click the Amend button before the hook is\n> done, this commit's message is replaced (in the editor, not the actual\n> commit) with the hook's result.\n\nWhen you click on amend the prepare-commit-msg hook is runned. But you\nsay that you click amend before \"the hook is done\". Which hook are you\ntalking about in this case? Are you clicking twice on amend?\n\n-- \nMed vänliga hälsningar\nFredrik Gustafsson\n\ntel: 0733-608274\ne-post: iveqy@iveqy.com\n"},{"id":"222541","messageId":"20130704103440.GH9161@serenity.lan","threadId":"34342","inReplyTo":"CAGHpTBKOX8G1PZqE2njQ1UbFJeC_L6WxjnTC5NyT8LSbiBNGXw@mail.gmail.com","subject":"Re: git gui replaces amend message when prepare-commit-msg hook is used","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-07-04T10:34:40Z","receivedAt":"2013-07-04T10:34:40Z","isPatch":false,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Thu, Jul 04, 2013 at 12:47:28PM +0300, Orgad Shaneh wrote:\n> Hi,\n> \n> If a prepare-commit-msg hook is used, git gui executes it for \"New Commit\".\n> \n> If the \"New Commit\" is selected, and then immediately \"Amend\" (before\n> the hook returns), when the hook returns the message is replaced with\n> the one produced by the hook.\n\nI think this is a problem with the hook you are running.  The hook is\ngiven arguments specifying the message file and optionally the source of\nwhatever is already in the file (see githooks(5) for details).\n\nIt sounds like your hook is blindly overwriting the file, rather than\npreserving its contents in the cases where you wish to do so.\n"},{"id":"222542","messageId":"CAGHpTB+ObJjqvQ-xfQOdGG+ZSZdCijVZXh1NBp97TZ=hO-QVgQ@mail.gmail.com","threadId":"34342","inReplyTo":"20130704103440.GH9161@serenity.lan","subject":"Re: git gui replaces amend message when prepare-commit-msg hook is used","fromName":"Orgad Shaneh","fromEmail":"orgads@gmail.com","sentAt":"2013-07-04T10:59:10Z","receivedAt":"2013-07-04T10:59:10Z","isPatch":false,"sender":{"key":"orgads@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1246544?v=4"},"body":"On Thu, Jul 4, 2013 at 1:34 PM, John Keeping <john@keeping.me.uk> wrote:\n> On Thu, Jul 04, 2013 at 12:47:28PM +0300, Orgad Shaneh wrote:\n>> Hi,\n>>\n>> If a prepare-commit-msg hook is used, git gui executes it for \"New Commit\".\n>>\n>> If the \"New Commit\" is selected, and then immediately \"Amend\" (before\n>> the hook returns), when the hook returns the message is replaced with\n>> the one produced by the hook.\n>\n> I think this is a problem with the hook you are running.  The hook is\n> given arguments specifying the message file and optionally the source of\n> whatever is already in the file (see githooks(5) for details).\n>\n> It sounds like your hook is blindly overwriting the file, rather than\n> preserving its contents in the cases where you wish to do so.\n\nLet me try to explain.\n\nWhen git gui is executed, it calls the prepare-commit-msg script with\n.git/PREPARE_COMMIT_MSG as an argument.\n\nWhen amend is selected, the hook is *not* called at all (what would it\nprepare? The message is already committed)\n\nUse the following hook to reproduce:\n--- snip ---\n#!/bin/sh\n\nsleep 5\necho \"$@\" >> /tmp/hook.log\necho 'Hello hook' > \"$1\"\n--- snip ---\n\nNow run git gui (or press F5 if it is already running), and before 5\nseconds pass, click Amend last commit. You'll see the commit's\nmessage, but when the 5 seconds pass it is replaced with \"Hello hook\".\nThat's the bug.\n\n- Orgad\n"},{"id":"222543","messageId":"20130704111717.GF17597@paksenarrion.iveqy.com","threadId":"34342","inReplyTo":"CAGHpTB+ObJjqvQ-xfQOdGG+ZSZdCijVZXh1NBp97TZ=hO-QVgQ@mail.gmail.com","subject":"Re: git gui replaces amend message when prepare-commit-msg hook is used","fromName":"Fredrik Gustafsson","fromEmail":"iveqy@iveqy.com","sentAt":"2013-07-04T11:17:17Z","receivedAt":"2013-07-04T11:17:17Z","isPatch":false,"sender":{"key":"iveqy@iveqy.com","avatar":"https://avatars.githubusercontent.com/u/761743?v=4"},"body":"On Thu, Jul 04, 2013 at 01:59:10PM +0300, Orgad Shaneh wrote:\n> On Thu, Jul 4, 2013 at 1:34 PM, John Keeping <john@keeping.me.uk> wrote:\n> > On Thu, Jul 04, 2013 at 12:47:28PM +0300, Orgad Shaneh wrote:\n> >> Hi,\n> >>\n> >> If a prepare-commit-msg hook is used, git gui executes it for \"New Commit\".\n> >>\n> >> If the \"New Commit\" is selected, and then immediately \"Amend\" (before\n> >> the hook returns), when the hook returns the message is replaced with\n> >> the one produced by the hook.\n> >\n> > I think this is a problem with the hook you are running.  The hook is\n> > given arguments specifying the message file and optionally the source of\n> > whatever is already in the file (see githooks(5) for details).\n> >\n> > It sounds like your hook is blindly overwriting the file, rather than\n> > preserving its contents in the cases where you wish to do so.\n> \n> Let me try to explain.\n> \n> When git gui is executed, it calls the prepare-commit-msg script with\n> .git/PREPARE_COMMIT_MSG as an argument.\n> \n> When amend is selected, the hook is *not* called at all (what would it\n> prepare? The message is already committed)\n> \n> Use the following hook to reproduce:\n> --- snip ---\n> #!/bin/sh\n> \n> sleep 5\n> echo \"$@\" >> /tmp/hook.log\n> echo 'Hello hook' > \"$1\"\n> --- snip ---\n> \n> Now run git gui (or press F5 if it is already running), and before 5\n> seconds pass, click Amend last commit. You'll see the commit's\n> message, but when the 5 seconds pass it is replaced with \"Hello hook\".\n> That's the bug.\n\nYeah I got what you mean, it looks like it's an update problem of the\ntest-box in git-gui. You can also get that textbox to be completely\nempty if you click back and foward between \"new commit\" and \"amend\". The\nhook is not always runned.\n\nI can confirm this bug. I don't think it related to pure git but to\ngit-gui.\n\nI imagine that \"new commit\" exectures the prepare-commit-msg hook and\nreplaces the textbox content with it. Something that should be correct,\nbut the you've already told the textbox to have an other value (the\nvalue of the commit to amend).\n\nThere should be a check before writing to the textbox if \"new commit\"\nstill is set.\n\n-- \nMed vänliga hälsningar\nFredrik Gustafsson\n\ntel: 0733-608274\ne-post: iveqy@iveqy.com\n"},{"id":"222544","messageId":"20130704111901.GI9161@serenity.lan","threadId":"34342","inReplyTo":"CAGHpTB+ObJjqvQ-xfQOdGG+ZSZdCijVZXh1NBp97TZ=hO-QVgQ@mail.gmail.com","subject":"Re: git gui replaces amend message when prepare-commit-msg hook is used","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-07-04T11:19:01Z","receivedAt":"2013-07-04T11:19:01Z","isPatch":false,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Thu, Jul 04, 2013 at 01:59:10PM +0300, Orgad Shaneh wrote:\n> On Thu, Jul 4, 2013 at 1:34 PM, John Keeping <john@keeping.me.uk> wrote:\n> > On Thu, Jul 04, 2013 at 12:47:28PM +0300, Orgad Shaneh wrote:\n> >> Hi,\n> >>\n> >> If a prepare-commit-msg hook is used, git gui executes it for \"New Commit\".\n> >>\n> >> If the \"New Commit\" is selected, and then immediately \"Amend\" (before\n> >> the hook returns), when the hook returns the message is replaced with\n> >> the one produced by the hook.\n> >\n> > I think this is a problem with the hook you are running.  The hook is\n> > given arguments specifying the message file and optionally the source of\n> > whatever is already in the file (see githooks(5) for details).\n> >\n> > It sounds like your hook is blindly overwriting the file, rather than\n> > preserving its contents in the cases where you wish to do so.\n> \n> Let me try to explain.\n> \n> When git gui is executed, it calls the prepare-commit-msg script with\n> .git/PREPARE_COMMIT_MSG as an argument.\n> \n> When amend is selected, the hook is *not* called at all (what would it\n> prepare? The message is already committed)\n> \n> Use the following hook to reproduce:\n> --- snip ---\n> #!/bin/sh\n> \n> sleep 5\n> echo \"$@\" >> /tmp/hook.log\n> echo 'Hello hook' > \"$1\"\n> --- snip ---\n> \n> Now run git gui (or press F5 if it is already running), and before 5\n> seconds pass, click Amend last commit. You'll see the commit's\n> message, but when the 5 seconds pass it is replaced with \"Hello hook\".\n> That's the bug.\n\nYes, and that's a bug in the hook.  The hook is called with a second\nargument \"commit\" but it is ignoring this and blindly overwriting the\nmessage.  githooks(5) says:\n\n    prepare-commit-msg\n        This hook is invoked by git commit right after preparing the default\n        log message, and before the editor is started.\n\n        It takes one to three parameters. The first is the name of the\n        file that contains the commit log message. The second is the\n        source of the commit message, and can be: message (if a -m or -F\n        option was given); template (if a -t option was given or the\n        configuration option commit.template is set); merge (if the\n        commit is a merge or a .git/MERGE_MSG file exists); squash (if a\n        .git/SQUASH_MSG file exists); or commit, followed by a commit\n        SHA1 (if a -c, -C or --amend option was given).\n\n        If the exit status is non-zero, git commit will abort.\n\n        The purpose of the hook is to edit the message file in place,\n        and it is not suppressed by the --no-verify option. A non-zero\n        exit means a failure of the hook and aborts the commit. It\n        should not be used as replacement for pre-commit hook.\n\nYour problem is that your hook script is not checking $2 so it is\noverwriting the message even when you do not want to do so.\n"},{"id":"222545","messageId":"CAGHpTBJzwuPw6u=DKUkik5w=hQoCF3F_4wqjuU3UJ528gfcdpA@mail.gmail.com","threadId":"34342","inReplyTo":"20130704111901.GI9161@serenity.lan","subject":"Re: git gui replaces amend message when prepare-commit-msg hook is used","fromName":"Orgad Shaneh","fromEmail":"orgads@gmail.com","sentAt":"2013-07-04T11:37:48Z","receivedAt":"2013-07-04T11:37:48Z","isPatch":false,"sender":{"key":"orgads@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1246544?v=4"},"body":"On Thu, Jul 4, 2013 at 2:19 PM, John Keeping <john@keeping.me.uk> wrote:\n> On Thu, Jul 04, 2013 at 01:59:10PM +0300, Orgad Shaneh wrote:\n>> On Thu, Jul 4, 2013 at 1:34 PM, John Keeping <john@keeping.me.uk> wrote:\n>> > On Thu, Jul 04, 2013 at 12:47:28PM +0300, Orgad Shaneh wrote:\n>> >> Hi,\n>> >>\n>> >> If a prepare-commit-msg hook is used, git gui executes it for \"New Commit\".\n>> >>\n>> >> If the \"New Commit\" is selected, and then immediately \"Amend\" (before\n>> >> the hook returns), when the hook returns the message is replaced with\n>> >> the one produced by the hook.\n>> >\n>> > I think this is a problem with the hook you are running.  The hook is\n>> > given arguments specifying the message file and optionally the source of\n>> > whatever is already in the file (see githooks(5) for details).\n>> >\n>> > It sounds like your hook is blindly overwriting the file, rather than\n>> > preserving its contents in the cases where you wish to do so.\n>>\n>> Let me try to explain.\n>>\n>> When git gui is executed, it calls the prepare-commit-msg script with\n>> .git/PREPARE_COMMIT_MSG as an argument.\n>>\n>> When amend is selected, the hook is *not* called at all (what would it\n>> prepare? The message is already committed)\n>>\n>> Use the following hook to reproduce:\n>> --- snip ---\n>> #!/bin/sh\n>>\n>> sleep 5\n>> echo \"$@\" >> /tmp/hook.log\n>> echo 'Hello hook' > \"$1\"\n>> --- snip ---\n>>\n>> Now run git gui (or press F5 if it is already running), and before 5\n>> seconds pass, click Amend last commit. You'll see the commit's\n>> message, but when the 5 seconds pass it is replaced with \"Hello hook\".\n>> That's the bug.\n>\n> Yes, and that's a bug in the hook.  The hook is called with a second\n> argument \"commit\" but it is ignoring this and blindly overwriting the\n> message.  githooks(5) says:\n>\n>     prepare-commit-msg\n>         This hook is invoked by git commit right after preparing the default\n>         log message, and before the editor is started.\n>\n>         It takes one to three parameters. The first is the name of the\n>         file that contains the commit log message. The second is the\n>         source of the commit message, and can be: message (if a -m or -F\n>         option was given); template (if a -t option was given or the\n>         configuration option commit.template is set); merge (if the\n>         commit is a merge or a .git/MERGE_MSG file exists); squash (if a\n>         .git/SQUASH_MSG file exists); or commit, followed by a commit\n>         SHA1 (if a -c, -C or --amend option was given).\n>\n>         If the exit status is non-zero, git commit will abort.\n>\n>         The purpose of the hook is to edit the message file in place,\n>         and it is not suppressed by the --no-verify option. A non-zero\n>         exit means a failure of the hook and aborts the commit. It\n>         should not be used as replacement for pre-commit hook.\n>\n> Your problem is that your hook script is not checking $2 so it is\n> overwriting the message even when you do not want to do so.\n\nNo, it isn't. Not by git-gui at least. Check /tmp/hook.log with the\nhook I provided...\n\n- Orgad\n"},{"id":"222546","messageId":"CALWbr2zAt4a6vkQy8PhP-dH5eZ9_5VMzbiWqSEKE_1V5rsfh+A@mail.gmail.com","threadId":"34342","inReplyTo":"CAGHpTBJzwuPw6u=DKUkik5w=hQoCF3F_4wqjuU3UJ528gfcdpA@mail.gmail.com","subject":"Re: git gui replaces amend message when prepare-commit-msg hook is used","fromName":"Antoine Pelisse","fromEmail":"apelisse@gmail.com","sentAt":"2013-07-04T12:42:40Z","receivedAt":"2013-07-04T12:42:40Z","isPatch":false,"sender":{"key":"apelisse@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1929644?v=4"},"body":">> Your problem is that your hook script is not checking $2 so it is\n>> overwriting the message even when you do not want to do so.\n>\n> No, it isn't. Not by git-gui at least. Check /tmp/hook.log with the\n> hook I provided...\n\nSo what you mean is that the hook is not executed with the correct parameters?\nCould you please provide the output of the /tmp/hook.log file (I can't\nreproduce right now) ?\n"},{"id":"222553","messageId":"CAGHpTBJhwzLdxiTynx-eBWj7wUwe4e6HPAB4g0jDHTeVF2rfeg@mail.gmail.com","threadId":"34342","inReplyTo":"CALWbr2zAt4a6vkQy8PhP-dH5eZ9_5VMzbiWqSEKE_1V5rsfh+A@mail.gmail.com","subject":"Re: git gui replaces amend message when prepare-commit-msg hook is used","fromName":"Orgad Shaneh","fromEmail":"orgads@gmail.com","sentAt":"2013-07-04T12:46:27Z","receivedAt":"2013-07-04T12:46:27Z","isPatch":false,"sender":{"key":"orgads@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1246544?v=4"},"body":"On Thu, Jul 4, 2013 at 3:42 PM, Antoine Pelisse <apelisse@gmail.com> wrote:\n>>> Your problem is that your hook script is not checking $2 so it is\n>>> overwriting the message even when you do not want to do so.\n>>\n>> No, it isn't. Not by git-gui at least. Check /tmp/hook.log with the\n>> hook I provided...\n>\n> So what you mean is that the hook is not executed with the correct parameters?\n> Could you please provide the output of the /tmp/hook.log file (I can't\n> reproduce right now) ?\n\nIt only runs for \"New commit\" (possibly with merge or squash as\narguments). In my case the log is:\n.git/PREPARE_COMMIT_MSG\n.git/PREPARE_COMMIT_MSG\n.git/PREPARE_COMMIT_MSG\n...\n\nNot running the hook for amend is another problem.\n\nWhat I referred to was that handling the hook's result is done without\nchecking if the state has changed while it was running, like Fredrik\nhas already pointed out.\n\n- Orgad\n"},{"id":"222650","messageId":"CALWbr2y52fHae=svf6vct1gRR-o1ocG_iF3yppHDipx1jjuODg@mail.gmail.com","threadId":"34342","inReplyTo":"CAGHpTBJhwzLdxiTynx-eBWj7wUwe4e6HPAB4g0jDHTeVF2rfeg@mail.gmail.com","subject":"Re: git gui replaces amend message when prepare-commit-msg hook is used","fromName":"Antoine Pelisse","fromEmail":"apelisse@gmail.com","sentAt":"2013-07-05T19:13:42Z","receivedAt":"2013-07-05T19:13:42Z","isPatch":false,"sender":{"key":"apelisse@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1929644?v=4"},"body":"On Thu, Jul 4, 2013 at 2:46 PM, Orgad Shaneh <orgads@gmail.com> wrote:\n> On Thu, Jul 4, 2013 at 3:42 PM, Antoine Pelisse <apelisse@gmail.com> wrote:\n>>>> Your problem is that your hook script is not checking $2 so it is\n>>>> overwriting the message even when you do not want to do so.\n>>>\n>>> No, it isn't. Not by git-gui at least. Check /tmp/hook.log with the\n>>> hook I provided...\n>>\n>> So what you mean is that the hook is not executed with the correct parameters?\n>> Could you please provide the output of the /tmp/hook.log file (I can't\n>> reproduce right now) ?\n>\n> It only runs for \"New commit\" (possibly with merge or squash as\n> arguments). In my case the log is:\n> .git/PREPARE_COMMIT_MSG\n> .git/PREPARE_COMMIT_MSG\n> .git/PREPARE_COMMIT_MSG\n> ...\n>\n> Not running the hook for amend is another problem.\n>\n> What I referred to was that handling the hook's result is done without\n> checking if the state has changed while it was running, like Fredrik\n> has already pointed out.\n\nYep, I've had a quick look at that, and clearly the problem seems to\ncome from git-gui.\nI have absolutely no knowledge of TCL so I won't be able to help.\nIndeed, from what I've seen it looks like prepare-commit-message hook\nis not called in amend case.\n\nI cc'ed Pat Thoyts as he's the maintainer of git-gui.\n\nSorry for not being able to help any further on this one.\n\nAntoine,\n"}]}