git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH RFC] builtin/log: include From in git show --format=email

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 18, 2025, 21:45 UTC
Message-ID
<xmqqh64rj5a9.fsf@gitster.g>
In-Reply-To
<D7UQ9PQOTOLT.26JEMSNOV4WP6@bootlin.com>
"Antonin Godard" <antonin.godard@bootlin.com> writes:
> 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().

"imply"? The documentation says so because the command was designed to work like so when the feature was added in mid 2022.

    34bc1b10 (format-patch: allow forcing the use of in-body From: header, 2022-08-29)
    d5fc07df (format-patch: learn format.forceInBodyFrom configuration variable, 2022-08-29)

Please refrain from using words that imply value-judgement from your analysis and stick to the facts; I'll try to do so in my messages, too.

As the log family of commands happen to share much of the implementation, their code paths pass the log-config structure which is a mixed bag. It does not necessarily mean all commands in the family use all the members in the structure.

> 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.
"correctly"?  

Changing the behaviour retroactively would mean that those who have been relying on the fact that in-body header configuration meant for "git format-patch" does not affect "git log" would suddenly start to see their output differently. So I'd worry how bad the downside would be.

Having said all that.

In hindsight, or if we pretend we were in 2005 and starting the project again from scratch, if we did not have any "format.*" configuration variables and instead all of these were "log.*", I'd agree with everything you said in the message I am responding to. In such a hypothetical world, we may not even have added a separate "format-patch" command, but used "git log" with an option to spit out its output into an individual file for every commit.

Previous: Antonin Godard
Message 4 of 4 in “builtin/log: include From in git show --format=email”
  1. builtin/log: include From in git show --format=emailAntonin Godard, Feb 14, 2025
  2. Junio C HamanoFeb 14, 2025
  3. Antonin GodardFeb 17, 2025
  4. Junio C HamanoFeb 18, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.