From: Shawn O. Pearce Date: Sun, 02 Mar 2008 22:41:52 GMT Subject: Re: Re* [PATCH] git-submodule: Don't blame when git-describe fails Message-ID: <20080302224152.GC8410@spearce.org> In-Reply-To: <7vy791oyqa.fsf@gitster.siamese.dyndns.org> Junio C Hamano wrote: > -- >8 -- > describe --always: fall back to showing an abbreviated object name ... > diff --git a/builtin-describe.c b/builtin-describe.c > index 05e309f..c1182a3 100644 > --- a/builtin-describe.c > +++ b/builtin-describe.c > @@ -146,6 +147,17 @@ static unsigned long finish_depth_computation( > return seen_commits; > } > > +static void cannot_describe(const unsigned char *sha1) NORETURN; > + > +static void cannot_describe(const unsigned char *sha1) > +{ > + if (always) { > + printf("%s\n", find_unique_abbrev(sha1, DEFAULT_ABBREV)); This should be "abbrev" not "DEFAULT_ABBREV" as then we honor the command line "describe --always --abbrev=16" (for example). > @@ -278,6 +290,8 @@ int cmd_describe(int argc, const char **argv, const char *prefix) > "consider most recent tags (default: 10)"), > OPT_STRING(0, "match", &pattern, "pattern", > "only consider tags matching "), > + OPT_BOOLEAN(0, "always", &always, > + "show abbreviated commit object as fallback"), > OPT_END(), > }; Sadly I cannot come up with a better name for this option. :-( -- Shawn.