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

commit-msg hook does not run on merge with --no-ff option

From
JDJoseph Dunne <jdunne525@gmail.com>
Date
Sep 11, 2017, 14:34 UTC
Message-ID
<CAC7pkbQhwLFQQjqBwaW=0j4iKFcLdKDucCMck-PsSAeCs0rqpw@mail.gmail.com>
I’ve globally configured git master branch to use the –no-ff option in
my .gitconfig file:
[branch "master"]
                mergeoptions = “-–no-ff”

When I merge a branch into master that would normally be a fast forward merge, the merge happens fine and follows the option –no-ff, creating a new commit, however my commit-msg hook does not run. (The commit-msg hook works fine in all other commits / merges.)

I tried changing my commit-msg hook to just be “exit 1” and it doesn’t abort a no-ff merge, so I’m certain the hook is just not being executed.

Next: Stefan Beller
Message 1 of 7 in “commit-msg hook does not run on merge with --no-ff option”
  1. Joseph DunneSep 11, 2017
  2. Stefan BellerSep 11, 2017
  3. Joseph DunneSep 12, 2017
  4. Kaartic SivaraamSep 15, 2017
  5. Joseph DunneSep 15, 2017
  6. Junio C HamanoSep 15, 2017
  7. Joseph DunneSep 20, 2017

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.