From: Junio C Hamano <gitster@pobox•com>
To: Taylor Blau <me@ttaylorr•com>
Cc: Cameron Steffen <cam.steffen94@gmail•com>, git@vger•kernel.org
Subject: Re: git revert --continue --no-verify
Date: Tue, 03 Aug 2021 17:38:13 -0700 [thread overview]
Message-ID: <xmqq4kc6rqmi.fsf@gitster.g> (raw)
In-Reply-To: <YQm+PWAtc3rixqsw@nand.local> (Taylor Blau's message of "Tue, 3 Aug 2021 18:07:57 -0400")
Taylor Blau <me@ttaylorr•com> writes:
> 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.
IIRC, the "--continue" option that creates a commit came much later
for lazy folks; the norm was to conclude your conflict resolution
with "git commit" so that the HEAD and the index and the working
tree matches before running "--continue". Wouldn't that work in
this case? That is
$ git <some sequencing command> A..B
...
... stops with conflict
$ edit
$ git add ...
$ git commit --no-verify
$ git <that sequencing command> --continue
next prev parent reply other threads:[~2021-08-04 0:38 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
2021-08-04 0:38 ` Junio C Hamano [this message]
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=xmqq4kc6rqmi.fsf@gitster.g \
--to=gitster@pobox$(echo .)com \
--cc=cam.steffen94@gmail$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=me@ttaylorr$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox