git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG?] format-patch: --cover-letter doesn't use --from
@ 2024-10-06 18:46 Kristoffer Haugsbakk
  0 siblings, 0 replies; only message in thread
From: Kristoffer Haugsbakk @ 2024-10-06 18:46 UTC (permalink / raw)
  To: git; +Cc: Kristoffer Haugsbakk, Kristoffer Haugsbakk

From: Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>

Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)

Steps to reproduce is in the test below.

I wanted to send patches with my own domain as the author but using my email
provider as the sender.

What did you expect to happen? (Expected behavior)

That the `--from` ident was used for the cover letter and the patches.

What happened instead? (Actual behavior)

The cover letter used my committer ident.  It correctly used the `--from` ident
for the patches.

What's different between what you expected and what actually happened?

-

Anything else you want to add:

See the test.

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.46.2
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
libcurl: 7.81.0
zlib: 1.2.11
uname: Linux 6.8.0-45-generic #45~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Sep 11 15:25:05 UTC 2 x86_64
compiler info: gnuc: 11.4
libc info: glibc: 2.35
$SHELL (typically, interactive shell): /bin/bash


[Enabled Hooks]
post-applypatch
post-checkout
post-commit
post-merge
post-rewrite
pre-auto-gc
reference-transaction
sendemail-validate

-- >8 --
Subject: t4014: exercise --from with --cover-letter
From: Kristoffer Haugsbakk <code@khaugsbakk.name>

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
---
 t/t4014-format-patch.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index 1c46e963e43..41a3fffcd2f 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -2548,4 +2548,14 @@ test_expect_success 'format-patch --default-prefix overrides format.noprefix' '
 	grep "^--- a/blorp" actual
 '
 
+test_expect_success '--cover-letter respects --from' '
+	git format-patch -1 --stdout --cover-letter \
+		--from="Me <me@example.com>" |
+		grep "^From: " | head -1 >actual &&
+	cat <<-\EOF >expect &&
+	From: Me <me@example.com>
+	EOF
+	test_cmp expect actual
+'
+
 test_done
-- 
2.46.1.641.g54e7913fcb6


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-10-06 18:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-06 18:46 [BUG?] format-patch: --cover-letter doesn't use --from Kristoffer Haugsbakk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).