From: Junio C Hamano <gitster@pobox.com>
To: Mirko Faina <mroik@delayed.space>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] format-patch: fix from header in cover letter
Date: Mon, 16 Feb 2026 03:01:09 -0800 [thread overview]
Message-ID: <xmqqv7fxdkay.fsf@gitster.g> (raw)
In-Reply-To: <aZAMr6XOwKkTa55q@exploit> (Mirko Faina's message of "Sat, 14 Feb 2026 06:49:23 +0100")
Mirko Faina <mroik@delayed.space> writes:
> Subject: Re: [PATCH] format-patch: fix from header in cover letter
Thanks. That reads well.
> From: Mroik <mroik@delayed.space>
The ident used here matches what is used on the signed-off-by line,
which is good. We tend to prefer people to use their real names,
though (and I suspect that your name probably has some multi-word
structure, not a single-word).
> Fixes "From" header for the cover letter when `--from` is passed
The usual way to compose a log message of this project is to
- Give an observation on how the current system works in the
present tense (so no need to say "Currently X is Y", or
"Previously X was Y" to describe the state before your change;
just "X is Y" is enough), and discuss what you perceive as a
problem in it.
- Propose a solution (optional---often, problem description
trivially leads to an obvious solution in reader's minds).
- Give commands to somebody editing the codebase to "make it so",
instead of saying "This commit does X".
in this order. I am guessing that the problem you are fixing, which
is not said explicitly in what you wrote, is that even when you run
"git format-patch --from='Me <me@my.address>'", the option is not
used for cover letter? If that is the case, perhaps I'd write
something along this line:
"git format-patch" takes "--from=<user ident>" command line
option, and the given ident is used for patch e-mails, but for
the cover letter e-mail, the option is ignored and the committer
ident of the current user is used.
Teach the make_cover_letter() function to honor the option,
instead of always using the current committer identity.
if I were making this change.
> Signed-off-by: Mroik <mroik@delayed.space>
Again, the ident used here matches what is used on the in-body From:
line, which is good.
> ---
> builtin/log.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
This can be tested easily without flakes, so we should add some test
in one of the t/t*-format-patch*.sh files to help people notice when
they breaks this fix by mistake in the future.
> diff --git a/builtin/log.c b/builtin/log.c
> index d43ca693bf..df41b43fce 100644
> --- a/builtin/log.c
> +++ b/builtin/log.c
> @@ -1345,7 +1345,7 @@ static void make_cover_letter(struct rev_info *rev, int use_separate_file,
> if (!cmit_fmt_is_mail(rev->commit_format))
> die(_("cover letter needs email format"));
>
> - committer = git_committer_info(0);
> + committer = cfg->from ? cfg->from : git_committer_info(0);
This is a correct and minimal change, but if I were making this
change, I'd probably rename the "committer" variable. Before the
"--from" option came into play, the function has always assumed that
it should make the cover letter message from the current user, using
their committer ident, which meant that the "From:" address and the
committer ident were synonymous from this function's point of view.
But now we are telling the function that its assumption is no longer
good, and teaching it to honor the "From:" address given in the cfg.
And the way this local variable is used is to point at a string that
is the ident used for the "From:" address, which is not necessarily
the same as committer ident in this new world order. So it is not
reader-friendly to keep using "committer" as the name of the
variable. Simply call it "from", perhaps?
> if (use_separate_file &&
> open_next_file(NULL, rev->numbered_files ? NULL : "cover-letter", rev, quiet))
Thanks.
next prev parent reply other threads:[~2026-02-16 11:01 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-14 5:49 [PATCH] format-patch: fix from header in cover letter Mirko Faina
2026-02-16 11:01 ` Junio C Hamano [this message]
2026-02-16 15:27 ` [PATCH v2] format-patch: fix From " Mirko Faina
2026-02-17 6:22 ` Patrick Steinhardt
2026-02-17 6:34 ` Jeff King
2026-02-17 13:21 ` D. Ben Knoble
2026-02-19 11:29 ` Jeff King
2026-02-19 12:03 ` Mirko Faina
2026-02-19 13:43 ` D. Ben Knoble
2026-02-17 15:22 ` Junio C Hamano
2026-02-19 11:43 ` Jeff King
2026-02-20 18:11 ` Junio C Hamano
2026-02-17 22:04 ` [PATCH] " Mroik
2026-02-17 22:13 ` Mirko Faina
2026-02-17 22:43 ` Junio C Hamano
2026-02-17 22:41 ` Junio C Hamano
2026-02-17 23:25 ` [PATCH v4] " Mirko Faina
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=xmqqv7fxdkay.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=mroik@delayed.space \
/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