git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Cc: msysgit@googlegroups.com
Subject: Re: Issue 356 in msysgit: 'git describe --always' doesn't work
Date: Fri, 23 Oct 2009 11:46:52 -0700	[thread overview]
Message-ID: <7v1vkuc5ib.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: 0016367b63e60b2cdb0476969d11@google.com

msysgit@googlecode.com writes:

> Comment #1 on issue 356 by snaury: 'git describe --always' doesn't work
> http://code.google.com/p/msysgit/issues/detail?id=356
>
> This is not msysgit fault, the same happens on Mac OS X with
> 1.6.5.1. I  guess --always doesn't work anymore...

Thanks for noticing.  I think it is a regression in d68dc34 (git-describe:
Die early if there are no possible descriptions, 2009-08-06)

-- >8 --
Subject: [PATCH] Do not fail "describe --always" in a tag-less repository

This fixes a regression introduce by d68dc34 (git-describe: Die early if
there are no possible descriptions, 2009-08-06).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin-describe.c  |    2 +-
 t/t6120-describe.sh |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/builtin-describe.c b/builtin-describe.c
index df67a73..7542b57 100644
--- a/builtin-describe.c
+++ b/builtin-describe.c
@@ -197,7 +197,7 @@ static void describe(const char *arg, int last_one)
 		for_each_ref(get_name, NULL);
 	}
 
-	if (!found_names)
+	if (!found_names && !always)
 		die("cannot describe '%s'", sha1_to_hex(sha1));
 
 	n = cmit->util;
diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh
index 8c7e081..f5a1b61 100755
--- a/t/t6120-describe.sh
+++ b/t/t6120-describe.sh
@@ -34,6 +34,8 @@ test_expect_success setup '
 	echo one >file && git add file && git commit -m initial &&
 	one=$(git rev-parse HEAD) &&
 
+	git describe --always HEAD &&
+
 	test_tick &&
 	echo two >file && git add file && git commit -m second &&
 	two=$(git rev-parse HEAD) &&

           reply	other threads:[~2009-10-23 18:47 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <0016367b63e60b2cdb0476969d11@google.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7v1vkuc5ib.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=msysgit@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).