Sending multiple patches under the same subject via git send-email

909 Views Asked by At

I want to send emails via git send-email in a way that the appear linked in the inbox of the receiver.

For example Topic Name '--> [PATCH 01/02] Added File1 '--> [PATCH 02/02] Added File2

How do I go about doing that?. I tried sending emails to my account on gmail, but for every patch sent, it creates a new thread.

1

There are 1 best solutions below

0
On

The official documentation details how to sending Patches with git send-email.
The alternative is GitGitGadget.

However, regarding send-email, make sure to use Git 2.34+ (Q4 2021):

Even when running "git send-email"(man) without its own threaded discussion support, a threading related header in one message is carried over to the subsequent message to result in an unwanted threading, which has been corrected with Git 2.34 (Q4 2021).

See commit e082113 (30 Aug 2021) by Marvin Häuser (mhaeuser).
(Merged by Junio C Hamano -- gitster -- in commit bd29bcf, 10 Sep 2021)

send-email: avoid incorrect header propagation

Signed-off-by: Jeff King
Signed-off-by: Marvin Häuser

If multiple independent patches are sent with send-email, even if the "In-Reply-To" and "References" headers are not managed by --thread or --in-reply-to, their values may be propagated from prior patches to subsequent patches with no such headers defined.

To mitigate this and potential future issues, make sure all global patch-specific variables are always either handled by command-specific code (e.g. threading), or are reset to their default values for every iteration.