All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Antonin Godard" <antonin.godard@bootlin.com>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: git@vger.kernel.org, "Emma Brooks" <me@pluvano.com>,
	"Patrick Steinhardt" <ps@pks.im>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Daniel Li" <dan@danielyli.com>
Subject: Re: [PATCH RFC] builtin/log: include From in git show --format=email
Date: Mon, 17 Feb 2025 13:42:47 +0100	[thread overview]
Message-ID: <D7UQ9PQOTOLT.26JEMSNOV4WP6@bootlin.com> (raw)
In-Reply-To: <xmqqh64wl0wl.fsf@gitster.g>

Hi Junio,

On Fri Feb 14, 2025 at 9:35 PM CET, Junio C Hamano wrote:
> Antonin Godard <antonin.godard@bootlin.com> writes:
>
>> Currently, when the format.from and format.forceInBodyFrom options are
>> configured, the command `git show --format=email <commit>` command does
>> not include "From: user <email>" in the body, even though I believe it
>> is expected when using this format.
>
> Aren't "format.*" configuration variables for "git format-patch",
> and not "git show" or "git log"?
>
> I do not see there is anything that needs fixing, but I may be
> missing something.

This is what the documentation seems to imply, but builtin/log.c uses these
configuration variables in git_log_config(), for example. In the same file,
cmd_show() uses git_log_config().

git show can be used with --format=email, and you can use the format.* options
to control the output of git show --format=email <ref>. For example:

  git -c format.subjectPrefix=FOO show --format=email HEAD

Will affect the subject.

With this reasoning in mind, I thought "git show --format=email" should also
benefit from the format.from and format.forceInBodyFrom variables, to correctly
display the output.

I should also mention that b4[1] uses `git show --format=email`[2] to generate the
patches. So at the moment any user using b4 does not have their format.from
variables satisfied. This is how I spotted this behavior, initially.

[1]: https://b4.docs.kernel.org/en/latest
[2]: https://git.kernel.org/pub/scm/utils/b4/b4.git/tree/src/b4/__init__.py#n3487

Antonin

-- 
Antonin Godard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2025-02-17 12:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-14 16:31 [PATCH RFC] builtin/log: include From in git show --format=email Antonin Godard
2025-02-14 20:35 ` Junio C Hamano
2025-02-17 12:42   ` Antonin Godard [this message]
2025-02-18 21:45     ` Junio C Hamano

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=D7UQ9PQOTOLT.26JEMSNOV4WP6@bootlin.com \
    --to=antonin.godard@bootlin.com \
    --cc=avarab@gmail.com \
    --cc=dan@danielyli.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@pluvano.com \
    --cc=ps@pks.im \
    /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.