public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2] format-patch: fix From header in cover letter
@ 2026-02-17 21:30 Mirko Faina
  0 siblings, 0 replies; 12+ messages in thread
From: Mirko Faina @ 2026-02-17 21:30 UTC (permalink / raw)
  To: Patrick Steinhardt; +Cc: Junio C Hamano, git

On Tue, Feb 17, 2026 at 07:22:08AM +0100, Patrick Steinhardt wrote:
> One thing that made me stop though is the folowing sentence in
> git-format-patch(1):
> 
>   Use ident in the From: header of each commit email.
> 
> The option explicitly mentions that we use "--from" for the commit
> emails, only, and that may be read as implying that it's not used for
> the cover letter.
> 
> I don't really know whether that wording is intentional, and I cannot
> come up with a good reason why it should be. But I'd say that the
> wording is something we should adjust.

I don't think any user would reasonably think that it wouldn't apply to
the cover letter as you're sending the whole patch series in bulk, as the
same person.

I will change the documentation to remove any ambiguity.

> We're not only testing the cover letter here though, but also the other
> generated patch. This makes it somewhat hard to verify that the test
> actually works as expected. Would it make sense to maybe use something
> like the following instead?
> 
>   test_expect_success '--from applies to cover letter' '
>   	test_when_finished "rm -rf patches" &&
>   	git format-patch -1 --cover-letter --from="Foo Bar <author@example.com>" -o patches &&
>   	echo "From: Foo Bar <author@example.com>" >expect &&
>   	grep "^From:" patches/0000-cover-letter.patch >patch.head &&
>   	test_cmp expect patch.head
>   '

Yes, makes sense, wouldn't want to generate a false negative on the
compliance of the "--from" option.
I will apply the suggested change.

Thank you

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: [PATCH v2] format-patch: fix From header in cover letter
@ 2026-02-17 21:41 Mirko Faina
  0 siblings, 0 replies; 12+ messages in thread
From: Mirko Faina @ 2026-02-17 21:41 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, Patrick Steinhardt, git

On Tue, Feb 17, 2026 at 07:22:33AM -0800, Junio C Hamano wrote:
> Yes.  It does make sense to document the change in thinking in the
> proposed log message and in documentation.

As I said to Patrick, I don't think anyone would reasonably expect
"--from" to not apply to the cover letter as well. Given this, I'm not
sure we should refer to this as a change in thinking in the commit
message, it should be treated as a bug as if it should've always been
this way.

I will edit the documentation to remove any ambiguity.

Thank you

^ permalink raw reply	[flat|nested] 12+ messages in thread
* [PATCH] format-patch: fix from header in cover letter
@ 2026-02-14  5:49 Mirko Faina
  2026-02-16 15:27 ` [PATCH v2] format-patch: fix From " Mirko Faina
  0 siblings, 1 reply; 12+ messages in thread
From: Mirko Faina @ 2026-02-14  5:49 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Mirko Faina

From: Mroik <mroik@delayed.space>

Fixes "From" header for the cover letter when `--from` is passed

Signed-off-by: Mroik <mroik@delayed.space>
---
 builtin/log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/log.c b/builtin/log.c
index d43ca693bf..df41b43fce 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -1345,7 +1345,7 @@ static void make_cover_letter(struct rev_info *rev, int use_separate_file,
 	if (!cmit_fmt_is_mail(rev->commit_format))
 		die(_("cover letter needs email format"));
 
-	committer = git_committer_info(0);
+	committer = cfg->from ? cfg->from : git_committer_info(0);
 
 	if (use_separate_file &&
 	    open_next_file(NULL, rev->numbered_files ? NULL : "cover-letter", rev, quiet))
-- 
2.53.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-02-20 18:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-17 21:30 [PATCH v2] format-patch: fix From header in cover letter Mirko Faina
  -- strict thread matches above, loose matches on Subject: below --
2026-02-17 21:41 Mirko Faina
2026-02-14  5:49 [PATCH] format-patch: fix from " Mirko Faina
2026-02-16 15:27 ` [PATCH v2] format-patch: fix From " Mirko Faina
2026-02-17  6:22   ` Patrick Steinhardt
2026-02-17  6:34     ` Jeff King
2026-02-17 13:21       ` D. Ben Knoble
2026-02-19 11:29         ` Jeff King
2026-02-19 12:03           ` Mirko Faina
2026-02-19 13:43           ` D. Ben Knoble
2026-02-17 15:22       ` Junio C Hamano
2026-02-19 11:43         ` Jeff King
2026-02-20 18:11           ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox