mbox series

[v2,0/3] format-patch --force-in-body-from

Message ID 20220829213837.13849-1-gitster@pobox.com (mailing list archive)
Headers show
Series format-patch --force-in-body-from | expand

Message

Junio C Hamano Aug. 29, 2022, 9:38 p.m. UTC
Users may be authoring and committing their commits under the same
e-mail address they use to send their patches from, in which case
they shouldn't need to use the in-body From: line in their outgoing
e-mails.  At the receiving end, "git am" will use the address on the
"From:" header of the incoming e-mail and all should be well.

Some mailing lists, however, mangle the From: address from what the
original sender had; in such an unfortunate situation, the user may
want to add the in-body "From:" header even for their own patch.

A new option `--force-in-body-from` from the command line of `git
format-patch`, and a new configuration variable `format.forceInBodyFrom`
that can be set per repository, are added to address this.

Changes since the original submission are

 * The configuration variable support is new.

 * comes with documentation updates.

 * "in-body" is spelled as such, not "inbody".

 * the order of config and option parsing plus initializing the
   rev_info structure dictates a separate variable to be used for
   the former two and then copied to rev_info later.

Junio C Hamano (3):
  pretty: separate out the logic to decide the use of in-body from
  format-patch: allow forcing the use of in-body From: header
  format-patch: learn format.forceInBodyFrom configuration variable

 Documentation/config/format.txt    |  4 ++++
 Documentation/git-format-patch.txt | 11 +++++++++
 builtin/log.c                      |  9 ++++++++
 pretty.c                           | 12 +++++++++-
 revision.h                         |  1 +
 t/t4014-format-patch.sh            | 37 ++++++++++++++++++++++++++++++
 6 files changed, 73 insertions(+), 1 deletion(-)