Re: [PATCH v2] format-patch: fix From header in cover letter

From: Mirko Faina <hidden>
Date: 2026-02-17 21:30:53

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 [off-list ref]" -o patches &&
  	echo "From: Foo Bar [off-list ref]" >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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help