{"thread":{"id":"19935","subject":"commit hooks on merge","startedAt":"2009-06-25T19:43:55Z","lastAt":"2009-07-11T11:56:36Z","messageCount":3,"participants":["Kurt Milligan","Tim Harper"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"116964","messageId":"4A43D37B.20203@surfmerchants.com","threadId":"19935","inReplyTo":null,"subject":"commit hooks on merge","fromName":"Kurt Milligan","fromEmail":"kurt@surfmerchants.com","sentAt":"2009-06-25T19:43:55Z","receivedAt":"2009-06-25T19:43:55Z","isPatch":false,"sender":{"key":"kurt@surfmerchants.com","avatar":null},"body":"Hi\n\nI asked this in #git, and did a quick Google search to no avail...\n\nAccording to the docs, merge does an auto-commit, but it seems that the \npre/post commit hooks are not run for this commit. Is that intentional? \nIs there a way I can make them run for the merge commit? I see there is \na post-merge hook, but that doesn't really help me if I want to stop the \nmerge...\n\nThanks in advance\n\n-Kurt\n"},{"id":"117814","messageId":"e1a5e9a00907102211m43522a09l49093ae50ea16e2a@mail.gmail.com","threadId":"19935","inReplyTo":"4A43D37B.20203@surfmerchants.com","subject":"Re: commit hooks on merge","fromName":"Tim Harper","fromEmail":"timcharper@gmail.com","sentAt":"2009-07-11T05:11:40Z","receivedAt":"2009-07-11T05:11:40Z","isPatch":false,"sender":{"key":"timcharper@gmail.com","avatar":"https://gravatar.com/avatar/1a2e0c06c7862ff065ee6b1d53195333a5a0577c040ecb2856a150d8e0b00ecd?d=mp&s=160"},"body":"Kurt\n\nI don't think there is a hook to prevent a merge from occurring.  I\nmean, you could probably rename git-merge, and then put a wrapper\nscript in its place.  That script could call the hook for the current\nrepository, if it exists and you could implement pre-merge.\n\nThis is if you REALLY REALLY want to do it :)\n\nTim\n\nOn Thu, Jun 25, 2009 at 1:43 PM, Kurt Milligan<kurt@surfmerchants.com> wrote:\n> Hi\n>\n> I asked this in #git, and did a quick Google search to no avail...\n>\n> According to the docs, merge does an auto-commit, but it seems that the\n> pre/post commit hooks are not run for this commit. Is that intentional? Is\n> there a way I can make them run for the merge commit? I see there is a\n> post-merge hook, but that doesn't really help me if I want to stop the\n> merge...\n>\n> Thanks in advance\n>\n> -Kurt\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n"},{"id":"117826","messageId":"4A587DF4.6090602@surfmerchants.com","threadId":"19935","inReplyTo":"e1a5e9a00907102211m43522a09l49093ae50ea16e2a@mail.gmail.com","subject":"Re: commit hooks on merge","fromName":"Kurt Milligan","fromEmail":"kurt@surfmerchants.com","sentAt":"2009-07-11T11:56:36Z","receivedAt":"2009-07-11T11:56:36Z","isPatch":false,"sender":{"key":"kurt@surfmerchants.com","avatar":null},"body":"Tim -\n\nThanks for the reply!\n\nFor completeness, my reason for wanting this hook is to be able to run \nsome automated tests on the code.\nI understand why you wouldn't want to execute a pre-commit hook on a \nmerge that is just a fast-forward, but if it's not a fast-forward, then \ncode is changing and automated tests could potentially fail...but the \npre-commit hook is not run, and there is no pre-merge hook.\n\nI searched the mailing lists, and it appears folks have submitted \npatches for both of these problems, but either they never made it into \nthe tree or got rejected...but in any case, it implies that I'm not the \nonly one with this concern.\n\nAnyway, thanks for your suggestion...I will try that route!\n\nThanks\n\n-Kurt\n\n\nTim Harper wrote:\n> Kurt\n>\n> I don't think there is a hook to prevent a merge from occurring.  I\n> mean, you could probably rename git-merge, and then put a wrapper\n> script in its place.  That script could call the hook for the current\n> repository, if it exists and you could implement pre-merge.\n>\n> This is if you REALLY REALLY want to do it :)\n>\n> Tim\n>\n> On Thu, Jun 25, 2009 at 1:43 PM, Kurt Milligan<kurt@surfmerchants.com> wrote:\n>   \n>> Hi\n>>\n>> I asked this in #git, and did a quick Google search to no avail...\n>>\n>> According to the docs, merge does an auto-commit, but it seems that the\n>> pre/post commit hooks are not run for this commit. Is that intentional? Is\n>> there a way I can make them run for the merge commit? I see there is a\n>> post-merge hook, but that doesn't really help me if I want to stop the\n>> merge...\n>>\n>> Thanks in advance\n>>\n>> -Kurt\n>> --\n>> To unsubscribe from this list: send the line \"unsubscribe git\" in\n>> the body of a message to majordomo@vger.kernel.org\n>> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>>\n>>     \n"}]}