From: Junio C Hamano Date: Fri, 10 Jan 2014 18:32:39 +0000 (-0800) Subject: Merge branch 'bc/log-decoration' X-Git-Tag: v1.9-rc0~36 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/f8c2e3f67133e82b1df9c4cc806ba5d67670e425?hp=-c Merge branch 'bc/log-decoration' "git log --decorate" did not handle a tag pointed by another tag nicely. * bc/log-decoration: log: properly handle decorations with chained tags --- f8c2e3f67133e82b1df9c4cc806ba5d67670e425 diff --combined log-tree.c index 642faffdb7,1982631ca4..08970bf46e --- a/log-tree.c +++ b/log-tree.c @@@ -98,7 -98,7 +98,7 @@@ static int add_ref_decoration(const cha struct object *obj; enum decoration_type type = DECORATION_NONE; - if (!prefixcmp(refname, "refs/replace/")) { + if (starts_with(refname, "refs/replace/")) { unsigned char original_sha1[20]; if (!read_replace_refs) return 0; @@@ -116,11 -116,11 +116,11 @@@ if (!obj) return 0; - if (!prefixcmp(refname, "refs/heads/")) + if (starts_with(refname, "refs/heads/")) type = DECORATION_REF_LOCAL; - else if (!prefixcmp(refname, "refs/remotes/")) + else if (starts_with(refname, "refs/remotes/")) type = DECORATION_REF_REMOTE; - else if (!prefixcmp(refname, "refs/tags/")) + else if (starts_with(refname, "refs/tags/")) type = DECORATION_REF_TAG; else if (!strcmp(refname, "refs/stash")) type = DECORATION_REF_STASH; @@@ -134,6 -134,8 +134,8 @@@ obj = ((struct tag *)obj)->tagged; if (!obj) break; + if (!obj->parsed) + parse_object(obj->sha1); add_name_decoration(DECORATION_REF_TAG, refname, obj); } return 0; @@@ -734,7 -736,7 +736,7 @@@ static int log_tree_diff(struct rev_inf if (!opt->diff && !DIFF_OPT_TST(&opt->diffopt, EXIT_WITH_STATUS)) return 0; - parse_commit(commit); + parse_commit_or_die(commit); sha1 = commit->tree->object.sha1; /* Root commit? */ @@@ -759,7 -761,7 +761,7 @@@ * parent, showing summary diff of the others * we merged _in_. */ - parse_commit(parents->item); + parse_commit_or_die(parents->item); diff_tree_sha1(parents->item->tree->object.sha1, sha1, "", &opt->diffopt); log_tree_diff_flush(opt); @@@ -774,7 -776,7 +776,7 @@@ for (;;) { struct commit *parent = parents->item; - parse_commit(parent); + parse_commit_or_die(parent); diff_tree_sha1(parent->tree->object.sha1, sha1, "", &opt->diffopt); log_tree_diff_flush(opt);