Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-08-30 00:38:36 +0300
committerJunio C Hamano <gitster@pobox.com>2022-08-30 00:39:13 +0300
commit34bc1b1045af6ad813f4de662a453b3c77ba65a7 (patch)
treea7806e9d87faec1d80e9b29d089c206af169a29d /pretty.c
parentb84d01393679d0e09d6fd198e771f2d1f5563986 (diff)
format-patch: allow forcing the use of in-body From: header
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 a situation, the user may want to add the in-body "From:" header even for their own patches. "git format-patch --[no-]force-in-body-from" was invented for such users. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pretty.c')
-rw-r--r--pretty.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/pretty.c b/pretty.c
index cf418a6b20..b7553e3fe0 100644
--- a/pretty.c
+++ b/pretty.c
@@ -480,6 +480,8 @@ end:
static int use_in_body_from(const struct pretty_print_context *pp,
const struct ident_split *ident)
{
+ if (pp->rev && pp->rev->force_in_body_from)
+ return 1;
if (ident_cmp(pp->from_ident, ident))
return 1;
return 0;