From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: git@vger.kernel.org
Subject: [PATCH 1/3] mailinfo.c: always collect the message-id
Date: Thu, 16 Oct 2025 14:57:56 -0400 [thread overview]
Message-ID: <20251016185758.21996-2-James.Bottomley@HansenPartnership.com> (raw)
In-Reply-To: <20251016185758.21996-1-James.Bottomley@HansenPartnership.com>
Prior to this mailinfo only collected the message-id if
add_messsage_id was true. Now git-am needs the message-id all the
time, hence the change, and anything checking to see if message-id
should be included in the trailer must check both any_message_id and
message_id.
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
---
mailinfo.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/mailinfo.c b/mailinfo.c
index 99ac596e09..62a30e37b1 100644
--- a/mailinfo.c
+++ b/mailinfo.c
@@ -609,8 +609,7 @@ static int check_header(struct mailinfo *mi,
goto check_header_out;
}
if (parse_header(line, "Message-ID", mi, &sb)) {
- if (mi->add_message_id)
- mi->message_id = strbuf_detach(&sb, NULL);
+ mi->message_id = strbuf_detach(&sb, NULL);
ret = 1;
goto check_header_out;
}
@@ -837,7 +836,7 @@ static int handle_commit_msg(struct mailinfo *mi, struct strbuf *line)
}
if (patchbreak(line)) {
- if (mi->message_id)
+ if (mi->add_message_id && mi->message_id)
strbuf_addf(&mi->log_message,
"Message-ID: %s\n", mi->message_id);
return 1;
--
2.51.0
next prev parent reply other threads:[~2025-10-16 18:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-16 18:57 [PATCH 0/3] add a message-id header to git James Bottomley
2025-10-16 18:57 ` James Bottomley [this message]
2025-10-16 18:57 ` [PATCH 2/3] builtin/am.c: add a message-id commit header James Bottomley
2025-10-16 22:41 ` brian m. carlson
2025-10-16 18:57 ` [PATCH 3/3] t4150-am: add a test for message-id header collection James Bottomley
2025-10-16 19:26 ` [PATCH 0/3] add a message-id header to git Kristoffer Haugsbakk
2025-10-16 20:10 ` James Bottomley
2025-10-16 20:31 ` Kristoffer Haugsbakk
2025-10-16 20:32 ` Junio C Hamano
2025-10-16 21:00 ` James Bottomley
2025-10-16 21:18 ` Junio C Hamano
2025-10-16 21:28 ` Kristoffer Haugsbakk
2025-10-16 21:50 ` Kristoffer Haugsbakk
2025-10-16 22:15 ` Junio C Hamano
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=20251016185758.21996-2-James.Bottomley@HansenPartnership.com \
--to=james.bottomley@hansenpartnership.com \
--cc=git@vger.kernel.org \
/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).