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

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

From
DTDmitry Torokhov <dmitry.torokhov@gmail.com>
Date
Jan 10, 2018, 19:25 UTC
Message-ID
<CAKdAkRSuNhEri+3eUbX8iVjr0JUyADSJBtgL==VjNwgKwe3Xqw@mail.gmail.com>
In-Reply-To
<xmqq1siy30zd.fsf@gitster.mtv.corp.google.com>
On Tue, Jan 9, 2018 at 6:24 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 15 quoted lines
>
> Dmitry Torokhov <dmitry.torokhov@gmail.com> writes:
>
> >> 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.
> >
> > This seems like a regression, at least for my use case. Unfortunately
> > my mail seems to get lost in the mailing list noise...
>
> Possibly.  Can you bisect to see which commit broke things for you?
> That would allow people who know what they themselves broke better
> than I do to take a look ;-)

Right, so it looks like the master works well, it is next(?) branch that is troublesome (apparently we pack experimental internally?).

I bisected it down to:
commit 356ee4659bb551cd9464b317d691827276752c2d (refs/bisect/bad)
Author: Phillip Wood <phillip.wood@dunelm.org.uk>
Date:   Fri Nov 24 11:07:57 2017 +0000
   sequencer: try to commit without forking 'git commit'
   If the commit message does not need to be edited then create the
   commit without forking 'git commit'. Taking the best time of ten runs
   with a warm cache this reduces the time taken to cherry-pick 10
   commits by 27% (from 282ms to 204ms), and the time taken by 'git
   rebase --continue' to pick 10 commits by 45% (from 386ms to 212ms) on
   my computer running linux. Some of greater saving for rebase is
   because it no longer wastes time creating the commit summary just to
   throw it away.
   The code to create the commit is based on builtin/commit.c. It is
   simplified as it doesn't have to deal with merges and modified so that
   it does not die but returns an error to make sure the sequencer exits
   cleanly, as it would when forking 'git commit'
   Even when not forking 'git commit' the commit message is written to a
   file and CHERRY_PICK_HEAD is created unnecessarily. This could be
   eliminated in future. I hacked up a version that does not write these
   files and just passed an strbuf (with the wrong message for fixup and
   squash commands) to do_commit() but I couldn't measure any significant
   time difference when running cherry-pick or rebase. I think
   eliminating the writes properly for rebase would require a bit of
   effort as the code would need to be restructured.
   Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
   Signed-off-by: Junio C Hamano <gitster@pobox.com>

With this commit the hook is not being run unless I specify '-e' flag to cherry-pick.

Thanks.
-- 
Dmitry
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 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.