Re: Re* [PATCH] git-submodule: Don't blame when git-describe fails
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Mar 2, 2008, 22:41 UTC
- Message-ID
- <20080302224152.GC8410@spearce.org>
- In-Reply-To
- <7vy791oyqa.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
> -- >8 -- > describe --always: fall back to showing an abbreviated object name
...
Show 14 quoted lines
> 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).
Show 8 quoted lines
> @@ -278,6 +290,8 @@ int cmd_describe(int argc, const char **argv, const char *prefix) > "consider <n> most recent tags (default: 10)"), > OPT_STRING(0, "match", &pattern, "pattern", > "only consider tags matching <pattern>"), > + 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.