From: Junio C Hamano Date: Fri, 9 Dec 2011 21:37:09 +0000 (-0800) Subject: Merge branch 'jc/pull-signed-tag' X-Git-Tag: v1.7.9-rc0~83 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=eb8aa3d2c2849cb3a44396b89054339df38e2bfa;p=git.git Merge branch 'jc/pull-signed-tag' * jc/pull-signed-tag: commit-tree: teach -m/-F options to read logs from elsewhere commit-tree: update the command line parsing commit: teach --amend to carry forward extra headers merge: force edit and no-ff mode when merging a tag object commit: copy merged signed tags to headers of merge commit merge: record tag objects without peeling in MERGE_HEAD merge: make usage of commit->util more extensible fmt-merge-msg: Add contents of merged tag in the merge message fmt-merge-msg: package options into a structure fmt-merge-msg: avoid early returns refs DWIMmery: use the same rule for both "git fetch" and others fetch: allow "git fetch $there v1.0" to fetch a tag merge: notice local merging of tags and keep it unwrapped fetch: do not store peeled tag object names in FETCH_HEAD Split GPG interface into its own helper library Conflicts: builtin/fmt-merge-msg.c builtin/merge.c --- eb8aa3d2c2849cb3a44396b89054339df38e2bfa diff --cc builtin/fmt-merge-msg.c index 26e741263,7dae846c5..ed95349b4 --- a/builtin/fmt-merge-msg.c +++ b/builtin/fmt-merge-msg.c @@@ -5,8 -5,7 +5,9 @@@ #include "revision.h" #include "tag.h" #include "string-list.h" +#include "branch.h" +#include "fmt-merge-msg.h" + #include "gpg-interface.h" static const char * const fmt_merge_msg_usage[] = { "git fmt-merge-msg [-m ] [--log[=]|--no-log] [--file ]", @@@ -342,16 -375,12 +414,13 @@@ int fmt_merge_msg(struct strbuf *in, st strbuf_addch(out, '\n'); for (i = 0; i < origins.nr; i++) - shortlog(origins.items[i].string, origins.items[i].util, + shortlog(origins.items[i].string, + origins.items[i].util, - head, &rev, shortlog_len, out); + head, &rev, opts->shortlog_len, out); } - return 0; - } - int fmt_merge_msg(struct strbuf *in, struct strbuf *out, - int merge_title, int shortlog_len) { - return do_fmt_merge_msg(merge_title, in, out, shortlog_len); + strbuf_complete_line(out); + return 0; } int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix) @@@ -382,16 -411,9 +452,8 @@@ 0); if (argc > 0) usage_with_options(fmt_merge_msg_usage, options); - if (shortlog_len < 0) - die("Negative --log=%d", shortlog_len); + shortlog_len = (merge_log_config > 0) ? merge_log_config : 0; - if (message && !shortlog_len) { - char nl = '\n'; - write_in_full(STDOUT_FILENO, message, strlen(message)); - write_in_full(STDOUT_FILENO, &nl, 1); - return 0; - } - if (shortlog_len < 0) - die("Negative --log=%d", shortlog_len); if (inpath && strcmp(inpath, "-")) { in = fopen(inpath, "r"); diff --cc builtin/merge.c index 3fc54923b,99f1429b3..7349396d5 --- a/builtin/merge.c +++ b/builtin/merge.c @@@ -1056,15 -1045,22 +1051,22 @@@ static void write_merge_state(void struct commit_list *j; struct strbuf buf = STRBUF_INIT; - for (j = remoteheads; j; j = j->next) - strbuf_addf(&buf, "%s\n", - sha1_to_hex(j->item->object.sha1)); + for (j = remoteheads; j; j = j->next) { + unsigned const char *sha1; + struct commit *c = j->item; + if (c->util && merge_remote_util(c)->obj) { + sha1 = merge_remote_util(c)->obj->sha1; + } else { + sha1 = c->object.sha1; + } + strbuf_addf(&buf, "%s\n", sha1_to_hex(sha1)); + } - fd = open(git_path("MERGE_HEAD"), O_WRONLY | O_CREAT, 0666); + filename = git_path("MERGE_HEAD"); + fd = open(filename, O_WRONLY | O_CREAT, 0666); if (fd < 0) - die_errno(_("Could not open '%s' for writing"), - git_path("MERGE_HEAD")); + die_errno(_("Could not open '%s' for writing"), filename); if (write_in_full(fd, buf.buf, buf.len) != buf.len) - die_errno(_("Could not write to '%s'"), git_path("MERGE_HEAD")); + die_errno(_("Could not write to '%s'"), filename); close(fd); strbuf_addch(&merge_msg, '\n'); write_merge_msg(&merge_msg);