{"thread":{"id":"4834","subject":"[PATCH 2/3] Add option to disable threading headers","startedAt":"2006-07-10T18:41:45Z","lastAt":"2006-07-10T18:42:12Z","messageCount":2,"participants":["Josh Triplett"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"23561","messageId":"1152556906.8890.47.camel@josh-work.beaverton.ibm.com","threadId":"4834","inReplyTo":"5b476cb7f1440875f348842a2ef581ab882e7d0d.1152550451.git.josh@freedesktop.org","subject":"[PATCH 2/3] Add option to disable threading headers","fromName":"Josh Triplett","fromEmail":"josht@us.ibm.com","sentAt":"2006-07-10T18:41:45Z","receivedAt":"2006-07-10T18:41:45Z","isPatch":true,"sender":{"key":"josh@joshtriplett.org","avatar":"https://avatars.githubusercontent.com/u/162737?v=4"},"body":"Add a --no-thread option to disable generation of In-Reply-To and References\nheaders, normally used to make the second and subsequent mails appear as\nreplies to the first.\n\nSigned-off-by: Josh Triplett <josh@freedesktop.org>\n---\nAs requested by Johannes Schindelin <johannes.schindelin@gmx.de>.\n\n Documentation/git-format-patch.txt |    8 +++++++-\n builtin-log.c                      |    5 ++++-\n 2 files changed, 11 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt\nindex 4ca0014..81e3a9a 100644\n--- a/Documentation/git-format-patch.txt\n+++ b/Documentation/git-format-patch.txt\n@@ -9,7 +9,7 @@ git-format-patch - Prepare patches for e\n SYNOPSIS\n --------\n [verse]\n-'git-format-patch' [-n | -k] [-o <dir> | --stdout] [--attach]\n+'git-format-patch' [-n | -k] [-o <dir> | --stdout] [--attach] [--no-thread]\n \t           [-s | --signoff] [--diff-options] [--start-number <n>]\n \t\t   <since>[..<until>]\n \n@@ -35,6 +35,9 @@ they are created in the current working \n If -n is specified, instead of \"[PATCH] Subject\", the first line\n is formatted as \"[PATCH n/m] Subject\".\n \n+The generated mails include In-Reply-To and References headers to make\n+the second and subsequent patch mails appear as replies to the first\n+mail; --no-thread disables this behavior.\n \n OPTIONS\n -------\n@@ -63,6 +66,9 @@ OPTIONS\n --attach::\n \tCreate attachments instead of inlining patches.\n \n+--no-thread::\n+\tDo not add In-Reply-To and References headers to make the\n+\tsecond and subsequent mails appear as replies to the first.\n \n CONFIGURATION\n -------------\ndiff --git a/builtin-log.c b/builtin-log.c\nindex 9d0cae1..97df715 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -242,6 +242,7 @@ int cmd_format_patch(int argc, const cha\n \tint start_number = -1;\n \tint keep_subject = 0;\n \tint ignore_if_in_upstream = 0;\n+\tint thread = 1;\n \tstruct diff_options patch_id_opts;\n \tchar *add_signoff = NULL;\n \tchar message_id[1024];\n@@ -311,6 +312,8 @@ int cmd_format_patch(int argc, const cha\n \t\t\trev.mime_boundary = argv[i] + 9;\n \t\telse if (!strcmp(argv[i], \"--ignore-if-in-upstream\"))\n \t\t\tignore_if_in_upstream = 1;\n+\t\telse if (!strcmp(argv[i], \"--no-thread\"))\n+\t\t\tthread = 0;\n \t\telse\n \t\t\targv[j++] = argv[i];\n \t}\n@@ -373,7 +376,7 @@ int cmd_format_patch(int argc, const cha\n \t\tcommit = list[nr];\n \t\trev.nr = total - nr + (start_number - 1);\n \t\t/* Make the second and subsequent mails replies to the first */\n-\t\tif (nr == (total - 2)) {\n+\t\tif (thread && nr == (total - 2)) {\n \t\t\tstrncpy(ref_message_id, message_id,\n \t\t\t\tsizeof(ref_message_id));\n \t\t\tref_message_id[sizeof(ref_message_id)-1] = '\\0';\n-- \n1.4.1.gf029\n"},{"id":"23562","messageId":"1152556932.8890.50.camel@josh-work.beaverton.ibm.com","threadId":"4834","inReplyTo":"5b476cb7f1440875f348842a2ef581ab882e7d0d.1152550451.git.josh@freedesktop.org","subject":"[PATCH 3/3] Add option to set initial In-Reply-To/References","fromName":"Josh Triplett","fromEmail":"josht@us.ibm.com","sentAt":"2006-07-10T18:42:12Z","receivedAt":"2006-07-10T18:42:12Z","isPatch":true,"sender":{"key":"josh@joshtriplett.org","avatar":"https://avatars.githubusercontent.com/u/162737?v=4"},"body":"Add the --in-reply-to option to provide a Message-Id for an initial\nIn-Reply-To/References header, useful for including a new patch series as part\nof an existing thread.\n\nSigned-off-by: Josh Triplett <josh@freedesktop.org>\n---\nSame behavior as git-send-email.\n\n Documentation/git-format-patch.txt |    6 ++++++\n builtin-log.c                      |   10 ++++++++++\n 2 files changed, 16 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt\nindex 81e3a9a..6a805c3 100644\n--- a/Documentation/git-format-patch.txt\n+++ b/Documentation/git-format-patch.txt\n@@ -11,6 +11,7 @@ SYNOPSIS\n [verse]\n 'git-format-patch' [-n | -k] [-o <dir> | --stdout] [--attach] [--no-thread]\n \t           [-s | --signoff] [--diff-options] [--start-number <n>]\n+\t\t   [--in-reply-to=Message-Id]\n \t\t   <since>[..<until>]\n \n DESCRIPTION\n@@ -70,6 +71,11 @@ OPTIONS\n \tDo not add In-Reply-To and References headers to make the\n \tsecond and subsequent mails appear as replies to the first.\n \n+--in-reply-to=Message-Id::\n+\tMake the first mail (or all the mails with --no-thread) appear as a\n+\treply to the given Message-Id, which avoids breaking threads to\n+\tprovide a new patch series.\n+\n CONFIGURATION\n -------------\n You can specify extra mail header lines to be added to each\ndiff --git a/builtin-log.c b/builtin-log.c\nindex 97df715..d0d70c4 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -243,6 +243,7 @@ int cmd_format_patch(int argc, const cha\n \tint keep_subject = 0;\n \tint ignore_if_in_upstream = 0;\n \tint thread = 1;\n+\tchar *in_reply_to = NULL;\n \tstruct diff_options patch_id_opts;\n \tchar *add_signoff = NULL;\n \tchar message_id[1024];\n@@ -314,6 +315,14 @@ int cmd_format_patch(int argc, const cha\n \t\t\tignore_if_in_upstream = 1;\n \t\telse if (!strcmp(argv[i], \"--no-thread\"))\n \t\t\tthread = 0;\n+\t\telse if (!strncmp(argv[i], \"--in-reply-to=\", 14))\n+\t\t\tin_reply_to = argv[i] + 14;\n+\t\telse if (!strcmp(argv[i], \"--in-reply-to\")) {\n+\t\t\ti++;\n+\t\t\tif (i == argc)\n+\t\t\t\tdie(\"Need a Message-Id for --in-reply-to\");\n+\t\t\tin_reply_to = argv[i];\n+\t\t}\n \t\telse\n \t\t\targv[j++] = argv[i];\n \t}\n@@ -371,6 +380,7 @@ int cmd_format_patch(int argc, const cha\n \tif (numbered)\n \t\trev.total = total + start_number - 1;\n \trev.add_signoff = add_signoff;\n+\trev.ref_message_id = in_reply_to;\n \twhile (0 <= --nr) {\n \t\tint shown;\n \t\tcommit = list[nr];\n-- \n1.4.1.gf029\n"}]}