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

The commit-msg hook is not invoked by git-merge as specified in documentation

From
KKKalle Kromann <kalle.kromann@man-es.com>
Date
Jun 3, 2020, 12:46 UTC
Message-ID
<AM0PR08MB55379DD182941E93F3BD3D37D7880@AM0PR08MB5537.eurprd08.prod.outlook.com>
Hello,
At least two places in the git docs it is specified that the hook "commit-msg" is invoked by both git-commit and git-merge.

https://git-scm.com/docs/githooks#_commit_msg https://git-scm.com/docs/git-merge#Documentation/git-merge.txt---no-verify

I'm experiencing a different behavior however. The hook seems to work fine on git-commit, but is not invoked by git-merge. When I use git-merge my text editor opens with the default message, but when I close the editor the hook is not invoked as I would expect.

For reference, the prepare-commit-msg hook works with both commands as expected.

Is there something subtle I'm overlooking? Of course a fast forward merge should not invoke the commit-msg hook, because no commit is made. But in my tests with non FF-merges the hook is still not invoked.

Kind regards, Kalle Kromann This is an e-mail from MAN Energy Solutions, branch of MAN Energy Solutions SE, Germany (CVR no. 31611792). This e-mail (including any attachments) is confidential and may be privileged. If you have received this e-mail by mistake, please notify the sender by e-mail and delete it from your system. Any unauthorized use or dissemination of this e-mail or its contents in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change. MAN Energy Solutions SE (including its group companies) shall not be liable for improper or incomplete transmission of the information contained in this e-mail or for any delay in its receipt. MAN Energy Solutions SE (or its group companies) does not guarantee that this e-mail has not been compromised or that it is free of viruses, interceptions or interference.

Next: Junio C Hamano
Message 1 of 5 in “The commit-msg hook is not invoked by git-merge as specified in documentation”
  1. Kalle KromannJun 3, 2020
  2. Junio C HamanoJun 3, 2020
  3. Kalle KromannJun 4, 2020
  4. Junio C HamanoJun 4, 2020
  5. Kalle KromannJun 4, 2020

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.