Code

Merge branch 'jc/pull-signed-tag'
authorJunio C Hamano <gitster@pobox.com>
Fri, 9 Dec 2011 21:37:09 +0000 (13:37 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 9 Dec 2011 21:37:09 +0000 (13:37 -0800)
* 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

1  2 
Makefile
builtin/commit.c
builtin/fetch.c
builtin/fmt-merge-msg.c
builtin/merge.c
cache.h
refs.c
t/t5510-fetch.sh

diff --cc Makefile
Simple merge
Simple merge
diff --cc builtin/fetch.c
Simple merge
index 26e74126397e576577b793c11da7dbcdaba7f727,7dae846c5298e9f040c80f72593dc327ccd538ea..ed95349b424f2f3d2aa671a277b346ae6198d34c
@@@ -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 <message>] [--log[=<n>]|--no-log] [--file <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)
                             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 3fc54923b500712097a4918f14a1e58b261e34c4,99f1429b350b69055244fe77ae769ae89bea809c..7349396d5b44f6ee894e0f0f50e2b66bb31203be
@@@ -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);
diff --cc cache.h
Simple merge
diff --cc refs.c
Simple merge
Simple merge