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

Re: [PATCH] describe: make '--always' fallback work after '--exact-match' failed

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 20, 2015, 18:39 UTC
Message-ID
<xmqqegix7qjk.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1440072823-18024-1-git-send-email-szeder@ira.uka.de>
SZEDER Gábor <szeder@ira.uka.de> writes:
Show 14 quoted lines
> 'git describe [...] --always' should always show the unique abbreviated
> object name as a fallback when the given commit cannot be described with
> the given set of options, see da2478dbb0 (describe --always: fall back
> to showing an abbreviated object name, 2008-03-02).
>
> However, this is not the case when the combination '--exact-match
> --always' is given and the commit cannot be described, because in such
> cases 'git describe' errors out, as if '--always' were not given at all.
>
> Respect '--always' and print the unique abbreviated object name instead
> of erroring out when the commit cannot be described with '--exact-match
> --always'.
>
> Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>

Well, that can be argued both ways. Your patch introduces a regression, as "--exact-match" is an instruction to error out when no tag exactly matches, and you deliberately break that.

My knee-jerk reaction is that the most sensible way forward is to make --exact-match and --always mutually incompatible.

Previous: SZEDER GáborNext: SZEDER Gábor
Message 2 of 9 in “describe: make '--always' fallback work after '--exact-match' failed”
  1. describe: make '--always' fallback work after '--exact-match' failedSZEDER Gábor, Aug 20, 2015
  2. Junio C HamanoAug 20, 2015
  3. SZEDER GáborAug 21, 2015
  4. Junio C HamanoAug 21, 2015
  5. describe --contains: default to HEAD when no commit-ish is givenSZEDER Gábor, Aug 21, 2015
  6. Junio C HamanoAug 21, 2015
  7. SZEDER GáborAug 24, 2015
  8. describe --contains: default to HEAD when no commit-ish is givenSZEDER Gábor, Aug 24, 2015
  9. Junio C HamanoAug 24, 2015

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.