git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kristoffer Haugsbakk <code@khaugsbakk.name>
To: git@vger.kernel.org
Cc: Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>,
	Kristoffer Haugsbakk <code@khaugsbakk.name>
Subject: [BUG?] format-patch: --cover-letter doesn't use --from
Date: Sun,  6 Oct 2024 20:46:10 +0200	[thread overview]
Message-ID: <95cb9cf15a4f3b17cee5f14fa0bcba9d40a0ebb8.1728239131.git.code@khaugsbakk.name> (raw)

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


                 reply	other threads:[~2024-10-06 18:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=95cb9cf15a4f3b17cee5f14fa0bcba9d40a0ebb8.1728239131.git.code@khaugsbakk.name \
    --to=code@khaugsbakk.name \
    --cc=git@vger.kernel.org \
    --cc=kristofferhaugsbakk@fastmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).