diff options
author | Junio C Hamano <gitster@pobox.com> | 2007-09-18 17:42:15 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-09-18 17:42:15 -0700 |
commit | 39bd2eb56af89d43a08ba54699d9a1849ab57b39 (patch) | |
tree | 7551a984921081bf2532f68303febe7275107ed1 /builtin-log.c | |
parent | 68d3025a805097ec148ec6e9b0b54a5db1ef138e (diff) | |
parent | 89df580d0a2e97b0c7c072d87e5e815534deed56 (diff) | |
download | git-39bd2eb56af89d43a08ba54699d9a1849ab57b39.tar.gz |
Merge branch 'master' into ph/strbuf
* master: (94 commits)
Fixed update-hook example allow-users format.
Documentation/git-svn: updated design philosophy notes
t/t4014: test "am -3" with mode-only change.
git-commit.sh: Shell script cleanup
preserve executable bits in zip archives
Fix lapsus in builtin-apply.c
git-push: documentation and tests for pushing only branches
git-svnimport: Use separate arguments in the pipe for git-rev-parse
contrib/fast-import: add perl version of simple example
contrib/fast-import: add simple shell example
rev-list --bisect: Bisection "distance" clean up.
rev-list --bisect: Move some bisection code into best_bisection.
rev-list --bisect: Move finding bisection into do_find_bisection.
Document ls-files --with-tree=<tree-ish>
git-commit: partial commit of paths only removed from the index
git-commit: Allow partial commit of file removal.
send-email: make message-id generation a bit more robust
git-apply: fix whitespace stripping
git-gui: Disable native platform text selection in "lists"
apply --index-info: fall back to current index for mode changes
...
Diffstat (limited to 'builtin-log.c')
-rw-r--r-- | builtin-log.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/builtin-log.c b/builtin-log.c index e1d3e7d74b..60819d15c5 100644 --- a/builtin-log.c +++ b/builtin-log.c @@ -437,6 +437,34 @@ static void gen_message_id(char *dest, unsigned int length, char *base) (int)(email_end - email_start - 1), email_start + 1); } +static const char *clean_message_id(const char *msg_id) +{ + char ch; + const char *a, *z, *m; + char *n; + size_t len; + + m = msg_id; + while ((ch = *m) && (isspace(ch) || (ch == '<'))) + m++; + a = m; + z = NULL; + while ((ch = *m)) { + if (!isspace(ch) && (ch != '>')) + z = m; + m++; + } + if (!z) + die("insane in-reply-to: %s", msg_id); + if (++z == m) + return a; + len = z - a; + n = xmalloc(len + 1); + memcpy(n, a, len); + n[len] = 0; + return n; +} + int cmd_format_patch(int argc, const char **argv, const char *prefix) { struct commit *commit; @@ -625,7 +653,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) if (numbered) rev.total = total + start_number - 1; rev.add_signoff = add_signoff; - rev.ref_message_id = in_reply_to; + if (in_reply_to) + rev.ref_message_id = clean_message_id(in_reply_to); while (0 <= --nr) { int shown; commit = list[nr]; |