From: Junio C Hamano Date: Tue, 10 Nov 2009 20:35:08 +0000 (-0800) Subject: Merge branch 'tr/describe-advice' X-Git-Tag: v1.6.6-rc0~60 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=38d3d92c75561d1c0877cf06c501efe493ded924;p=git.git Merge branch 'tr/describe-advice' * tr/describe-advice: describe: when failing, tell the user about options that work --- 38d3d92c75561d1c0877cf06c501efe493ded924 diff --cc builtin-describe.c index 390c14ec5,504d9b120..d4efb10dd --- a/builtin-describe.c +++ b/builtin-describe.c @@@ -267,13 -257,17 +268,20 @@@ static void describe(const char *arg, i if (!match_cnt) { const unsigned char *sha1 = cmit->object.sha1; if (always) { - printf("%s\n", find_unique_abbrev(sha1, abbrev)); + printf("%s", find_unique_abbrev(sha1, abbrev)); + if (dirty) + printf("%s", dirty); + printf("\n"); return; } - die("cannot describe '%s'", sha1_to_hex(sha1)); + if (unannotated_cnt) + die("No annotated tags can describe '%s'.\n" + "However, there were unannotated tags: try --tags.", + sha1_to_hex(sha1)); + else + die("No tags can describe '%s'.\n" + "Try --always, or create some tags.", + sha1_to_hex(sha1)); } qsort(all_matches, match_cnt, sizeof(all_matches[0]), compare_pt);