format-patch: fix From header in cover letter
Quoted 5 lines · Patrick Steinhardt
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.
Quoted 7 lines
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.
Quoted 5 lines
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?
Quoted 7 lines
test_expect_success '--from applies to cover letter' ' test_when_finished "rm -rf patches" && git format-patch -1 --cover-letter --from="Foo Bar <[email protected]>" -o patches && echo "From: Foo Bar <[email protected]>" >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