{"thread":{"id":"21660","subject":"[PATCH] describe: do not use unannotated tag even if exact match","startedAt":"2009-11-18T13:32:26Z","lastAt":"2009-11-18T13:32:26Z","messageCount":1,"participants":["Thomas Rast"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"127846","messageId":"985ab43f219852a6d5dc302424fd1c012e19a09e.1258551042.git.trast@student.ethz.ch","threadId":"21660","inReplyTo":null,"subject":"[PATCH] describe: do not use unannotated tag even if exact match","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-11-18T13:32:26Z","receivedAt":"2009-11-18T13:32:26Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"4d23660 (describe: when failing, tell the user about options that\nwork, 2009-10-28) forgot to update the shortcut path where the code\ndetected and used a possible exact match.  This means that an\nunannotated tag on HEAD would be used by 'git describe'.\n\nGuard this code path against the new circumstances, where unannotated\ntags can be present in ->util even if we're not actually planning to\nuse them.\n\nWhile there, also add some tests for --all.\n\nReported by 'yashi' on IRC.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n builtin-describe.c  |    2 +-\n t/t6120-describe.sh |    6 ++++++\n 2 files changed, 7 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-describe.c b/builtin-describe.c\nindex d4efb10..71be2a9 100644\n--- a/builtin-describe.c\n+++ b/builtin-describe.c\n@@ -200,7 +200,7 @@ static void describe(const char *arg, int last_one)\n \t\tdie(\"%s is not a valid '%s' object\", arg, commit_type);\n \n \tn = cmit->util;\n-\tif (n) {\n+\tif (n && (tags || all || n->prio == 2)) {\n \t\t/*\n \t\t * Exact match to an existing ref.\n \t\t */\ndiff --git a/t/t6120-describe.sh b/t/t6120-describe.sh\nindex c050f94..065dead 100755\n--- a/t/t6120-describe.sh\n+++ b/t/t6120-describe.sh\n@@ -92,12 +92,18 @@ check_describe A-* HEAD^\n check_describe D-* HEAD^^\n check_describe A-* HEAD^^2\n check_describe B HEAD^^2^\n+check_describe D-* HEAD^^^\n \n check_describe c-* --tags HEAD\n check_describe c-* --tags HEAD^\n check_describe e-* --tags HEAD^^\n check_describe c-* --tags HEAD^^2\n check_describe B --tags HEAD^^2^\n+check_describe e --tags HEAD^^^\n+\n+check_describe heads/master --all HEAD\n+check_describe tags/c-* --all HEAD^\n+check_describe tags/e --all HEAD^^^\n \n check_describe B-0-* --long HEAD^^2^\n check_describe A-3-* --long HEAD^^2\n-- \n1.6.5.3.381.gfeb7e\n"}]}