threads / discuss / 49357

Differences between git show HEAD and git show head

Subject: Differences between git show HEAD and git show head

## tl;dr

3 messages between Sep 17, 2018 and Sep 17, 2018.

replies: 2people: 2as markdown or json

Nikola Milekic· Sep 17, 2018, 11:22 UTC · lore
Hi,

On Windows, when using multiple workspaces and git 2.19.0.windows.1, 'git show HEAD' and 'git show head' return different results when executed from a secondary workspace (the one without the .git directory).

'git show HEAD' shows the HEAD of the current workspace, while git show head shows the HEAD of the main workspace (the one with the .git directory). I find this to be highly misleading, especially for users like myself who are not used to typing HEAD in all caps. Is this indented behavior or a bug?

Thanks.

Best regards, Nikola

Ævar Arnfjörð Bjarmason· Sep 17, 2018, 13:23 UTC · re: Nikola Milekic · lore

Re: Differences between git show HEAD and git show head

On Mon, Sep 17 2018, Nikola Milekic wrote:
Show 12 quoted lines
> Hi,
>
> On Windows, when using multiple workspaces and git 2.19.0.windows.1,
> 'git show HEAD' and 'git show head' return different results when
> executed from a secondary workspace (the one without the .git
> directory).
>
> 'git show HEAD' shows the HEAD of the current workspace, while git
> show head shows the HEAD of the main workspace (the one with the .git
> directory). I find this to be highly misleading, especially for users
> like myself who are not used to typing HEAD in all caps. Is this
> indented behavior or a bug?

This is an outstanding bug in git that's tricky to solve (maybe you're interested!), here's a recent discussion about it: https://public-inbox.org/git/87ziclb2pa.fsf@gmail.com/

Nikola Milekic· Sep 17, 2018, 13:33 UTC · re: Ævar Arnfjörð Bjarmason · lore

Re: Differences between git show HEAD and git show head

Ups, my bad, didn't realize that. Apologies for spamming. Would love to help but unfortunately I have no C background. On Mon, Sep 17, 2018 at 3:23 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:

Show 20 quoted lines
>
>
> On Mon, Sep 17 2018, Nikola Milekic wrote:
>
> > Hi,
> >
> > On Windows, when using multiple workspaces and git 2.19.0.windows.1,
> > 'git show HEAD' and 'git show head' return different results when
> > executed from a secondary workspace (the one without the .git
> > directory).
> >
> > 'git show HEAD' shows the HEAD of the current workspace, while git
> > show head shows the HEAD of the main workspace (the one with the .git
> > directory). I find this to be highly misleading, especially for users
> > like myself who are not used to typing HEAD in all caps. Is this
> > indented behavior or a bug?
>
> This is an outstanding bug in git that's tricky to solve (maybe you're
> interested!), here's a recent discussion about it:
> https://public-inbox.org/git/87ziclb2pa.fsf@gmail.com/

← back to recent threads