{"thread":{"id":"21339","subject":"Re: Issue 356 in msysgit: 'git describe --always' doesn't work","startedAt":"2009-10-23T18:46:52Z","lastAt":"2009-10-23T18:46:52Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"125796","messageId":"7v1vkuc5ib.fsf@alter.siamese.dyndns.org","threadId":"21339","inReplyTo":"0016367b63e60b2cdb0476969d11@google.com","subject":"Re: Issue 356 in msysgit: 'git describe --always' doesn't work","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-10-23T18:46:52Z","receivedAt":"2009-10-23T18:46:52Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"msysgit@googlecode.com writes:\n\n> Comment #1 on issue 356 by snaury: 'git describe --always' doesn't work\n> http://code.google.com/p/msysgit/issues/detail?id=356\n>\n> This is not msysgit fault, the same happens on Mac OS X with\n> 1.6.5.1. I  guess --always doesn't work anymore...\n\nThanks for noticing.  I think it is a regression in d68dc34 (git-describe:\nDie early if there are no possible descriptions, 2009-08-06)\n\n-- >8 --\nSubject: [PATCH] Do not fail \"describe --always\" in a tag-less repository\n\nThis fixes a regression introduce by d68dc34 (git-describe: Die early if\nthere are no possible descriptions, 2009-08-06).\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n builtin-describe.c  |    2 +-\n t/t6120-describe.sh |    2 ++\n 2 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-describe.c b/builtin-describe.c\nindex df67a73..7542b57 100644\n--- a/builtin-describe.c\n+++ b/builtin-describe.c\n@@ -197,7 +197,7 @@ static void describe(const char *arg, int last_one)\n \t\tfor_each_ref(get_name, NULL);\n \t}\n \n-\tif (!found_names)\n+\tif (!found_names && !always)\n \t\tdie(\"cannot describe '%s'\", sha1_to_hex(sha1));\n \n \tn = cmit->util;\ndiff --git a/t/t6120-describe.sh b/t/t6120-describe.sh\nindex 8c7e081..f5a1b61 100755\n--- a/t/t6120-describe.sh\n+++ b/t/t6120-describe.sh\n@@ -34,6 +34,8 @@ test_expect_success setup '\n \techo one >file && git add file && git commit -m initial &&\n \tone=$(git rev-parse HEAD) &&\n \n+\tgit describe --always HEAD &&\n+\n \ttest_tick &&\n \techo two >file && git add file && git commit -m second &&\n \ttwo=$(git rev-parse HEAD) &&\n"}]}