From: Junio C Hamano Date: Tue, 23 Jan 2018 21:16:28 +0000 (-0800) Subject: Merge branch 'dk/describe-all-output-fix' X-Git-Tag: v2.17.0-rc0~153 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/fac64e011f1b1ecabcccf7ad2511efcac3e26bdc Merge branch 'dk/describe-all-output-fix' An old regression in "git describe --all $annotated_tag^0" has been fixed. * dk/describe-all-output-fix: describe: prepend "tags/" when describing tags with embedded name --- fac64e011f1b1ecabcccf7ad2511efcac3e26bdc diff --cc builtin/describe.c index 3b0b204b1e,2004a1a86e..6fe1c51281 --- a/builtin/describe.c +++ b/builtin/describe.c @@@ -274,19 -271,23 +274,22 @@@ static void append_name(struct commit_n n->name_checked = 1; } - if (n->tag) + if (n->tag) { + if (all) - printf("tags/"); - printf("%s", n->tag->tag); ++ strbuf_addstr(dst, "tags/"); + strbuf_addstr(dst, n->tag->tag); - else + } else { - printf("%s", n->path); + strbuf_addstr(dst, n->path); + } } -static void show_suffix(int depth, const struct object_id *oid) +static void append_suffix(int depth, const struct object_id *oid, struct strbuf *dst) { - printf("-%d-g%s", depth, find_unique_abbrev(oid->hash, abbrev)); + strbuf_addf(dst, "-%d-g%s", depth, find_unique_abbrev(oid->hash, abbrev)); } -static void describe(const char *arg, int last_one) +static void describe_commit(struct object_id *oid, struct strbuf *dst) { - struct object_id oid; struct commit *cmit, *gave_up_on = NULL; struct commit_list *list; struct commit_name *n;