All of lore.kernel.org
 help / color / mirror / Atom feed
From: Taylor Blau <me@ttaylorr.com>
To: Cameron Steffen <cam.steffen94@gmail.com>
Cc: Taylor Blau <me@ttaylorr.com>, git@vger.kernel.org
Subject: Re: git revert --continue --no-verify
Date: Tue, 3 Aug 2021 18:07:57 -0400	[thread overview]
Message-ID: <YQm+PWAtc3rixqsw@nand.local> (raw)
In-Reply-To: <CAAVFnNmitHeimogaGUUwWGWhve+wbF6CXcSNUonGCWAgOSKzjA@mail.gmail.com>

On Tue, Aug 03, 2021 at 04:33:09PM -0500, Cameron Steffen wrote:
> Perhaps the issue then is that the pre-commit hook should not run for
> `git revert --continue`? It does not run for `git revert`.

This does look like an oversight to me, but you'll have to bear with me
since I am relatively unfamiliar with the sequencer code.

Ultimately `git revert` calls do_pick_commit() which either calls
do_commit() or run_git_commit(). A couple of curiosities there:

  - do_commit() does fall back to run_git_commit() if it has the
    VERIFY_MSG bit set in `flags`.
  - run_git_commit() passes `-n` only when VERIFY_MSG *isn't* set, so
    the VERIFY_MSG bit does imply that the pre-commit hook would be run
    there.
  - when do_pick_commit() does have to fall back to run_git_commit(), it
    sets the VERIFY_MSG bit in flags.

But we never end up calling run_git_commit() (except in the case of
errors) because do_pick_commit() special-cases `command == TODO_REVERT`
(which is the case for `git revert`) and calls `do_commit()`.

But it gets weirder: do_commit() calls run_git_commit() itself, but
before the caller in do_pick_commit() has had a chance to add VERIFY_MSG
to the flags.

So I suspect that this is an oversight, but perhaps somebody more
familiar with this code could confirm my thinking.

Thanks,
Taylor

  reply	other threads:[~2021-08-03 22:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-03 19:17 git revert --continue --no-verify Cameron Steffen
2021-08-03 20:50 ` Taylor Blau
2021-08-03 20:56   ` Cameron Steffen
2021-08-03 20:59     ` Taylor Blau
2021-08-03 21:33       ` Cameron Steffen
2021-08-03 22:07         ` Taylor Blau [this message]
2021-08-04  0:38           ` Junio C Hamano
2021-08-04 18:14           ` Phillip Wood
2021-08-05  1:40             ` Taylor Blau
2021-08-05  1:56               ` Cameron Steffen

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

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

  git send-email \
    --in-reply-to=YQm+PWAtc3rixqsw@nand.local \
    --to=me@ttaylorr.com \
    --cc=cam.steffen94@gmail.com \
    --cc=git@vger.kernel.org \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.