On 26/08/2022 19.20, Junio C Hamano wrote: > Konstantin Ryabitsev <konstantin@xxxxxxxxxxxxxxxxxxx> 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