[BUG?] format-patch: --cover-letter doesn't use --from

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Kristoffer Haugsbakk <kristofferhaugsbakk@xxxxxxxxxxxx>

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@xxxxxxxxxxxxxxx>

Signed-off-by: Kristoffer Haugsbakk <code@xxxxxxxxxxxxxxx>
---
 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@xxxxxxxxxxx>" |
+		grep "^From: " | head -1 >actual &&
+	cat <<-\EOF >expect &&
+	From: Me <me@xxxxxxxxxxx>
+	EOF
+	test_cmp expect actual
+'
+
 test_done
-- 
2.46.1.641.g54e7913fcb6





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux