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

3 messages from 2012-11-19 to 2012-11-19. Participants: Francis Moreau, Junio C Hamano.
Thread: https://gitlist.dev/t/32147

## Francis Moreau, 2012-11-19 15:47

Subject: git-describe fails with "--dirty is incompatible with committishes" if passing HEAD as argument
Message-ID: <CAC9WiBjw0W4kLCKMj6HhdjAXOJYpDW2Rgncb+06ahjiYOWtZ8Q@mail.gmail.com>
URL: https://gitlist.dev/e/CAC9WiBjw0W4kLCKMj6HhdjAXOJYpDW2Rgncb%2B06ahjiYOWtZ8Q%40mail.gmail.com

```
Hello,

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 ?

Thanks
--
Francis

```

## Junio C Hamano, 2012-11-19 19:36

Subject: Re: git-describe fails with "--dirty is incompatible with committishes" if passing HEAD as argument
Message-ID: <7vfw45xu4e.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vfw45xu4e.fsf%40alter.siamese.dyndns.org
In-Reply-To: <CAC9WiBjw0W4kLCKMj6HhdjAXOJYpDW2Rgncb+06ahjiYOWtZ8Q@mail.gmail.com>

```
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.

```

## Francis Moreau, 2012-11-19 20:39

Subject: Re: git-describe fails with "--dirty is incompatible with committishes" if passing HEAD as argument
Message-ID: <CAC9WiBjcUMOpa_KvS-8k0bWR=XTqVRT_qFLx1keVmG1nee8GOw@mail.gmail.com>
URL: https://gitlist.dev/e/CAC9WiBjcUMOpa_KvS-8k0bWR%3DXTqVRT_qFLx1keVmG1nee8GOw%40mail.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:
> 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

```
