git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Ping Yin
Message 4 of 4 in “git-submodule: Don't blame when git-describe fails”
  1. git-submodule: Don't blame when git-describe failsPing Yin, Mar 2, 2008
  2. Re* [PATCH] git-submodule: Don't blame when git-describe failsJunio C Hamano, Mar 2, 2008
  3. Ping YinMar 2, 2008
  4. Shawn O. PearceMar 2, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.