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

prepare-commit-msg hook no longer run for cherry-pick?

From
DTDmitry Torokhov <dmitry.torokhov@gmail.com>
Date
Jan 5, 2018, 18:48 UTC
Message-ID
<CAKdAkRQuj1hfKeckjuR2oP+8C1i+ZR36O-+aRYif4ufaS_zs+w@mail.gmail.com>
Hi,

I had prepare-commit-msg hook that would scrub "Patchwork-ID: NNNN" tags form commit messages and would update input mailing list patchwork to mark corresponding patches as "accepted" when I cherry pick form WIP/review queue into branches that I publish, but that recently stopped working if I do a simple cherry-pick. If I specify that I want to edit the message, then the hook is executed:

dtor@dtor-ws:~/kernel/master (for-linus)$ GIT_TRACE=2 git cherry-pick ff162c1554efe951ba6c7a19a228fc76a91fe1ed    
10:43:12.832426 git.c:344               trace: built-in: git 'cherry-pick' 'ff162c1554efe951ba6c7a19a228fc76a91fe1ed'
[for-linus 48bc600a3659] Input: raydium_i2c_ts - include hardware version in firmware name
Author: Jeffrey Lin <jeffrey.lin@rad-ic.com>
Date: Thu Jan 4 21:35:23 2018 -0800
1 file changed, 12 insertions(+), 2 deletions(-)
dtor@dtor-ws:~/kernel/master (for-linus)$ gti reset --hard HEAD^            
HEAD is now at 02a0d9216d4d Input: xen-kbdfront - do not advertise multi-touch pressure support
dtor@dtor-ws:~/kernel/master (for-linus)$ GIT_TRACE=2 git cherry-pick -e ff162c1554efe951ba6c7a19a228fc76a91fe1ed
10:43:24.433162 git.c:344               trace: built-in: git 'cherry-pick' '-e' 'ff162c1554efe951ba6c7a19a228fc76a91fe1ed'
10:43:24.782355 run-command.c:627       trace: run_command: 'commit' '-n' '-e'
10:43:24.786460 git.c:344               trace: built-in: git 'commit' '-n' '-e'
10:43:25.082164 run-command.c:627       trace: run_command: '.git/hooks/prepare-commit-msg' '.git/COMMIT_EDITMSG' 'merge'
hint: Waiting for your editor to close the file...
10:43:31.491551 run-command.c:627       trace: run_command: 'vim' '/usr/local/goo gle/home/dtor/kernel/master/.git/COMMIT_EDITMSG'
[for-linus 039c57df0ec8] Input: raydium_i2c_ts - include hardware version in firmware name
Author: Jeffrey Lin <jeffrey.lin@rad-ic.com>
Date: Thu Jan 4 21:35:23 2018 -0800
1 file changed, 12 insertions(+), 2 deletions(-)
dtor@dtor-ws:~/kernel/master (for-linus)$

Also note that the argument to the hook is "merge" whereas I think it used to be "cherry-pick" earlier.

Is this behavior intentional? dpkg reports version as 2.16.0~rc0+next.
Thanks!
-- 
Dmitry
Next: Dmitry Torokhov
Message 1 of 23 in “prepare-commit-msg hook no longer run for cherry-pick?”
  1. Dmitry TorokhovJan 5, 2018
  2. Dmitry TorokhovJan 10, 2018
  3. Junio C HamanoJan 10, 2018
  4. Dmitry TorokhovJan 10, 2018
  5. Junio C HamanoJan 10, 2018
  6. 0/2 sequencer: run 'prepare-commit-msg' hookPhillip Wood, Jan 19, 2018
  7. 1/2 t7505: Add tests for cherry-pick and rebase -i/-pPhillip Wood, Jan 19, 2018
  8. Eric SunshineJan 20, 2018
  9. 2/2 sequencer: run 'prepare-commit-msg' hookPhillip Wood, Jan 19, 2018
  10. 0/2 sequencer: run 'prepare-commit-msg' hook​Phillip Wood, Jan 23, 2018
  11. 1/2 t7505: Add tests for cherry-pick and rebase -i/-pPhillip Wood, Jan 23, 2018
  12. Junio C HamanoJan 23, 2018
  13. Junio C HamanoJan 23, 2018
  14. 2/2 sequencer: run 'prepare-commit-msg' hookPhillip Wood, Jan 23, 2018
  15. 0/3 sequencer: run 'prepare-commit-msg' hookPhillip Wood, Jan 24, 2018
  16. 3/3 sequencer: run 'prepare-commit-msg' hookPhillip Wood, Jan 24, 2018
  17. Ramsay JonesJan 24, 2018
  18. Junio C HamanoJan 24, 2018
  19. Phillip WoodJan 25, 2018
  20. Johannes SchindelinJan 29, 2018
  21. 1/3 t7505: style fixesPhillip Wood, Jan 24, 2018
  22. 2/3 t7505: Add tests for cherry-pick and rebase -i/-pPhillip Wood, Jan 24, 2018
  23. Eric SunshineJan 24, 2018

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.