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

Re: git-describe fails with "--dirty is incompatible with committishes" if passing HEAD as argument

From
FMFrancis Moreau <francis.moro@gmail.com>
Date
Nov 19, 2012, 20:39 UTC
Message-ID
<CAC9WiBjcUMOpa_KvS-8k0bWR=XTqVRT_qFLx1keVmG1nee8GOw@mail.gmail.com>
In-Reply-To
<7vfw45xu4e.fsf@alter.siamese.dyndns.org>
On Mon, Nov 19, 2012 at 8:36 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 25 quoted lines
> Francis Moreau <francis.moro@gmail.com> writes:
>
>> Inside the kernel repository, I tried this:
>>
>> $ git describe --dirty --match 'v[0-9]*' --abbrev=4 HEAD
>> fatal: --dirty is incompatible with committishes
>>
>> If 'HEAD' is removed then git-describe works as expected.
>>
>> Is that expected ?
>
> I would say so, at least in modern codebase.
>
> "git describe" without any commit object name used to mean "describe
> the HEAD commit using the better known points" before the --dirty
> option was introduced.
>
> But "--dirty" makes it describe the current checkout.  For example,
> output from "git describe --dirty" v1.8.0-211-gd8b4531-dirty means
> "your working tree contains work-in-progress based on d8b4531, which
> is 211 commits ahead of the v1.8.0 tag".  So conceptually, it should
> not take any commit, even if it were spelled HEAD.
>
> "git describe --dirty HEAD^^" would be an utter nonsense for the
> same reason.
Thanks for explaining, that makes sense.

-- Francis

Previous: Junio C Hamano
Message 3 of 3 in “git-describe fails with "--dirty is incompatible with committishes" if passing HEAD as argument”
  1. Francis MoreauNov 19, 2012
  2. Junio C HamanoNov 19, 2012
  3. Francis MoreauNov 19, 2012

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.