From: Michael J Gruber <git@grubix.eu>
To: Git List <git@vger.kernel.org>
Subject: prepare-commit-msg hook during rebase
Date: Mon, 15 Apr 2024 12:36:08 +0200 [thread overview]
Message-ID: <CAA19uiQip=EsbT8uQCs+98brYSTbOqyHX1ZBhssi4df3dZmZ6Q@mail.gmail.com> (raw)
Hi there
For a while now, I thought I was using prepare-commit-msg hook wrong
but finally took the time to analyse this further. Per the doc, the
hook receives the source of the commit message as $2
(message/template/merge/squash/commit or empty).
I notice the following with `rebase -i`:
- When rb applies a patch to be edited/reworded, the hook is called
with `commit` as the message source.
- When rb applies a patch merely to be picked, the hook is called with
`message` as the message source.
The latter also happens when non-interactive rebase applies commits.
I find this confusing for two reasons:
- Whether edit/reword or pick, there is always a commit being applied,
and it's the source of the message. So why not `commit` in both cases?
- The doc says that `message` is for inputs from `-m` or `-F`. So,
certainly this should not apply when the message comes from a picked
commit.
Also, I'm not sure whether the claim about `-m` is true, but that's
another issue; we even might want to distinguish between `-m` and `-F`
here.
Does the source `message` during rb pick occur due to an
implementation detail, maybe since the rewrite to sequencer?
Cheers
Michael
next reply other threads:[~2024-04-15 10:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-15 10:36 Michael J Gruber [this message]
2024-04-15 14:01 ` prepare-commit-msg hook during rebase Phillip Wood
2024-04-15 14:32 ` Michael J Gruber
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='CAA19uiQip=EsbT8uQCs+98brYSTbOqyHX1ZBhssi4df3dZmZ6Q@mail.gmail.com' \
--to=git@grubix.eu \
--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 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).