git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Phillip Wood <phillip.wood@dunelm.org.uk>
Subject: Re: prepare-commit-msg hook no longer run for cherry-pick?
Date: Wed, 10 Jan 2018 11:25:59 -0800	[thread overview]
Message-ID: <CAKdAkRSuNhEri+3eUbX8iVjr0JUyADSJBtgL==VjNwgKwe3Xqw@mail.gmail.com> (raw)
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:
>
> 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

  reply	other threads:[~2018-01-10 19:26 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-05 18:48 prepare-commit-msg hook no longer run for cherry-pick? Dmitry Torokhov
2018-01-10  0:39 ` Dmitry Torokhov
2018-01-10  2:24   ` Junio C Hamano
2018-01-10 19:25     ` Dmitry Torokhov [this message]
2018-01-10 21:14       ` Junio C Hamano
2018-01-19 14:19       ` [PATCH 0/2] sequencer: run 'prepare-commit-msg' hook Phillip Wood
2018-01-19 14:19         ` [PATCH 1/2] t7505: Add tests for cherry-pick and rebase -i/-p Phillip Wood
2018-01-20  0:48           ` Eric Sunshine
2018-01-19 14:19         ` [PATCH 2/2] sequencer: run 'prepare-commit-msg' hook Phillip Wood
2018-01-23 10:24       ` [PATCH v2 0/2] sequencer: run 'prepare-commit-msg' hook​ Phillip Wood
2018-01-23 10:24         ` [PATCH v2 1/2] t7505: Add tests for cherry-pick and rebase -i/-p Phillip Wood
2018-01-23 18:41           ` Junio C Hamano
2018-01-23 18:41           ` Junio C Hamano
2018-01-23 10:24         ` [PATCH v2 2/2] sequencer: run 'prepare-commit-msg' hook Phillip Wood
2018-01-24 12:34       ` [PATCH v3 0/3] " Phillip Wood
2018-01-24 12:34         ` [PATCH v3 1/3] t7505: style fixes Phillip Wood
2018-01-24 12:34         ` [PATCH v3 2/3] t7505: Add tests for cherry-pick and rebase -i/-p Phillip Wood
2018-01-24 18:39           ` Eric Sunshine
2018-01-24 12:34         ` [PATCH v3 3/3] sequencer: run 'prepare-commit-msg' hook Phillip Wood
2018-01-24 18:51           ` Ramsay Jones
2018-01-24 18:59             ` Junio C Hamano
2018-01-25 16:33               ` Phillip Wood
2018-01-29 23:06           ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKdAkRSuNhEri+3eUbX8iVjr0JUyADSJBtgL==VjNwgKwe3Xqw@mail.gmail.com' \
    --to=dmitry.torokhov@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=phillip.wood@dunelm.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).