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

Re: forcing an in-body From header

From
Rasmus Villemoes <rv@rasmusvillemoes.dk>
Date
Aug 29, 2022, 11:56 UTC
Message-ID
<f07a2387-dbbc-fd13-9817-069767c75165@rasmusvillemoes.dk>
In-Reply-To
<xmqqo7w6yl8y.fsf@gitster.g>
On 26/08/2022 19.20, Junio C Hamano wrote:
Show 13 quoted lines
> Konstantin Ryabitsev <konstantin@linuxfoundation.org> writes:
> 
>> I agree that it's a nice feature to have, though I would put this into the
>> sendemail config instead of using an env variable, something like:
>>
>>     [sendemail]
>>       in-body-headers = From
> 
> A change only for send-email does sound quite attractive.
> 
> I encourage folks to run format-patch first, make amends as needed
> in the output files, proofread the result once again, all before
> finally handing it to send-email for sending out. 
That's at least my usual workflow, yes.
 If a "force
> in-body headers" command line option plus a configuration variable
> added to "git send-email" would work for them, I would be OK with
> such a change.

It would work for me, except that if I am to rely on git send-email to munge the body of the file(s) I pass to it, I'd really like a way for --dry-run to reassure me that that will actually happen. Currently that only prints the headers, which is quite useful to check that the To and Cc are as expected (especially when one has some to-cmd or cc-cmd configured).

> There may be folks who do not use "git send-email" to send out their
> patches, and a change to "git format-patch" may help them, though.

Maybe, yes. I also stumbled on this paragraph in git format-patch --help which would probably need some adjustment

           Note that this option is only useful if you are actually
sending the
           emails and want to identify yourself as the sender, but
retain the
           original author (and git am will correctly pick up the in-body
           header). Note also that git send-email already handles this
           transformation for you, and this option should not be used if
you are
           feeding the result to git send-email.

I don't know how git send-email behaves if there already is an in-body From, or if it is different than the one that send-email was about to add itself.

Somehow I got the cover letter of the mini-series, but neither of the two actual patches. I can't answer the big-picture question of whether this belongs in format-patch, send-email or both, but:

> * Should it be "inbody" or "in-body"?
in-body, I think.
> * Should it have a corresponding configuration variable?

Most definitely yes, it's something I'd want to set for certain projects in the local .git/config file, and not a command line option I want to have to remember when doing the occasional contribution for those projects.

Thanks for the quick responses and initial draft work on this.
Rasmus
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 5 in “forcing an in-body From header”
  1. Rasmus VillemoesAug 26, 2022
  2. Konstantin RyabitsevAug 26, 2022
  3. Junio C HamanoAug 26, 2022
  4. Rasmus VillemoesAug 29, 2022
  5. Junio C HamanoAug 26, 2022

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.