Add option to set initial In-Reply-To/References
Add the --in-reply-to option to provide a Message-Id for an initial In-Reply-To/References header, useful for including a new patch series as part of an existing thread. Signed-off-by: Josh Triplett <josh@freedesktop.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Josh Triplett committed
Jul 14, 2006 at 17:49 UTC
da56645dd7c1175fc2ed1628ac35fdd35e705641
2 files changed
+16
Documentation/git-format-patch.txt
+6
@@ -11,6 +11,7 @@ SYNOPSIS
11
[verse]
12
'git-format-patch' [-n | -k] [-o <dir> | --stdout] [--attach] [--thread]
13
[-s | --signoff] [--diff-options] [--start-number <n>]
14
+ [--in-reply-to=Message-Id]
15
<since>[..<until>]
16
17
DESCRIPTION
@@ -72,6 +73,11 @@ OPTIONS
73
subsequent mails appear as replies to the first. Also generates
74
the Message-Id header to reference.
75
76
+--in-reply-to=Message-Id::
77
+ Make the first mail (or all the mails with --no-thread) appear as a
78
+ reply to the given Message-Id, which avoids breaking threads to
79
+ provide a new patch series.
80
+
81
CONFIGURATION
82
-------------
83
You can specify extra mail header lines to be added to each
builtin-log.c
+10
@@ -249,6 +249,7 @@ int cmd_format_patch(int argc, const char **argv, char **envp)
249
int keep_subject = 0;
250
int ignore_if_in_upstream = 0;
251
int thread = 0;
252
+ char *in_reply_to = NULL;
253
struct diff_options patch_id_opts;
254
char *add_signoff = NULL;
255
char message_id[1024];
@@ -320,6 +321,14 @@ int cmd_format_patch(int argc, const char **argv, char **envp)
321
ignore_if_in_upstream = 1;
322
else if (!strcmp(argv[i], "--thread"))
323
thread = 1;
324
+ else if (!strncmp(argv[i], "--in-reply-to=", 14))
325
+ in_reply_to = argv[i] + 14;
326
+ else if (!strcmp(argv[i], "--in-reply-to")) {
327
+ i++;
328
+ if (i == argc)
329
+ die("Need a Message-Id for --in-reply-to");
330
+ in_reply_to = argv[i];
331
+ }
332
else
333
argv[j++] = argv[i];
334
}
@@ -377,6 +386,7 @@ int cmd_format_patch(int argc, const char **argv, char **envp)
386
if (numbered)
387
rev.total = total + start_number - 1;
388
rev.add_signoff = add_signoff;
389
+ rev.ref_message_id = in_reply_to;
390
while (0 <= --nr) {
391
int shown;
392
commit = list[nr];