summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d1566f7)
raw | patch | inline | side by side (parent: d1566f7)
author | Josh Triplett <josht@us.ibm.com> | |
Sat, 15 Jul 2006 00:49:04 +0000 (17:49 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 15 Jul 2006 03:41:37 +0000 (20:41 -0700) |
Add a --thread option to enable generation of In-Reply-To and References
headers, used to make the second and subsequent mails appear as replies to the
first.
Signed-off-by: Josh Triplett <josh@freedesktop.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
headers, used to make the second and subsequent mails appear as replies to the
first.
Signed-off-by: Josh Triplett <josh@freedesktop.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/git-format-patch.txt | patch | blob | history | |
builtin-log.c | patch | blob | history |
index 4ca0014dac64729bee11b6a37bd730b538b2e5ee..305bd79154fabea871419ab56b4a6f01f58b6a57 100644 (file)
SYNOPSIS
--------
[verse]
-'git-format-patch' [-n | -k] [-o <dir> | --stdout] [--attach]
+'git-format-patch' [-n | -k] [-o <dir> | --stdout] [--attach] [--thread]
[-s | --signoff] [--diff-options] [--start-number <n>]
<since>[..<until>]
If -n is specified, instead of "[PATCH] Subject", the first line
is formatted as "[PATCH n/m] Subject".
+If given --thread, git-format-patch will generate In-Reply-To and
+References headers to make the second and subsequent patch mails appear
+as replies to the first mail; this also generates a Message-Id header to
+reference.
OPTIONS
-------
--attach::
Create attachments instead of inlining patches.
+--thread::
+ Add In-Reply-To and References headers to make the second and
+ subsequent mails appear as replies to the first. Also generates
+ the Message-Id header to reference.
CONFIGURATION
-------------
diff --git a/builtin-log.c b/builtin-log.c
index 1f1074cec66d367d217fffc611dc45981ea67013..6466768051038ac7cbd77deb8c5b5b6e3456fd02 100644 (file)
--- a/builtin-log.c
+++ b/builtin-log.c
int start_number = -1;
int keep_subject = 0;
int ignore_if_in_upstream = 0;
+ int thread = 0;
struct diff_options patch_id_opts;
char *add_signoff = NULL;
char message_id[1024];
rev.mime_boundary = argv[i] + 9;
else if (!strcmp(argv[i], "--ignore-if-in-upstream"))
ignore_if_in_upstream = 1;
+ else if (!strcmp(argv[i], "--thread"))
+ thread = 1;
else
argv[j++] = argv[i];
}
commit = list[nr];
rev.nr = total - nr + (start_number - 1);
/* Make the second and subsequent mails replies to the first */
- if (nr == (total - 2)) {
- strncpy(ref_message_id, message_id,
- sizeof(ref_message_id));
- ref_message_id[sizeof(ref_message_id)-1] = '\0';
- rev.ref_message_id = ref_message_id;
+ if (thread) {
+ if (nr == (total - 2)) {
+ strncpy(ref_message_id, message_id,
+ sizeof(ref_message_id));
+ ref_message_id[sizeof(ref_message_id)-1]='\0';
+ rev.ref_message_id = ref_message_id;
+ }
+ gen_message_id(message_id, sizeof(message_id),
+ sha1_to_hex(commit->object.sha1));
+ rev.message_id = message_id;
}
- gen_message_id(message_id, sizeof(message_id),
- sha1_to_hex(commit->object.sha1));
- rev.message_id = message_id;
if (!use_stdout)
reopen_stdout(commit, rev.nr, keep_subject);
shown = log_tree_commit(&rev, commit);