git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: commit hooks on merge

From
Tim Harper <timcharper@gmail.com>
Date
Jul 11, 2009, 05:11 UTC
Message-ID
<e1a5e9a00907102211m43522a09l49093ae50ea16e2a@mail.gmail.com>
In-Reply-To
<4A43D37B.20203@surfmerchants.com>
Kurt

I don't think there is a hook to prevent a merge from occurring. I mean, you could probably rename git-merge, and then put a wrapper script in its place. That script could call the hook for the current repository, if it exists and you could implement pre-merge.

This is if you REALLY REALLY want to do it :)
Tim
On Thu, Jun 25, 2009 at 1:43 PM, Kurt Milligan<kurt@surfmerchants.com> wrote:
Show 18 quoted lines
> Hi
>
> I asked this in #git, and did a quick Google search to no avail...
>
> According to the docs, merge does an auto-commit, but it seems that the
> pre/post commit hooks are not run for this commit. Is that intentional? Is
> there a way I can make them run for the merge commit? I see there is a
> post-merge hook, but that doesn't really help me if I want to stop the
> merge...
>
> Thanks in advance
>
> -Kurt
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
Previous: Kurt MilliganNext: Kurt Milligan
Message 2 of 3 in “commit hooks on merge”
  1. Kurt MilliganJun 25, 2009
  2. Tim HarperJul 11, 2009
  3. Kurt MilliganJul 11, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.