From: Junio C Hamano Date: Tue, 19 Mar 2013 17:54:03 GMT Subject: Re* git merge behavior Message-ID: <7v7gl3jmx0.fsf_-_@alter.siamese.dyndns.org> In-Reply-To: <7vfvzrjrad.fsf@alter.siamese.dyndns.org> Junio C Hamano writes: >> 2) git merge VS git merge >> ... >> It would be great to have Git using the tag message and check the >> signature. > > Perhaps, but if you feed the $(git rev-parse v1.12.2) to merge, your > subject will not be able to say "Merge tag 'v1.12.2'" in the first > place, so I do not think you would want to encourage such usage in > the first place. A patch to do so may look like this. You would probably want to also do read_sha1_file(desc->obj->sha1) here and parse out the header line "tag " to replace the "remote" to recover the symbolic tag name, but I didn't bother in this illustration. diff --git a/builtin/merge.c b/builtin/merge.c index 0ec8f0d..990e90c 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -516,6 +516,19 @@ static void merge_name(const char *remote, struct strbuf *msg) strbuf_release(&line); goto cleanup; } + + if (remote_head->util) { + struct merge_remote_desc *desc; + desc = merge_remote_util(remote_head); + if (desc && desc->obj && desc->obj->type == OBJ_TAG) { + strbuf_addf(msg, "%s\t\t%s '%s'\n", + sha1_to_hex(desc->obj->sha1), + typename(desc->obj->type), + remote); + goto cleanup; + } + } + strbuf_addf(msg, "%s\t\tcommit '%s'\n", sha1_to_hex(remote_head->object.sha1), remote); cleanup: