Re: Should "git log --decorate" indicate whether the HEAD is detached?

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: Should "git log --decorate" indicate whether the HEAD is detached?

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:03:51

Michael J Gruber [off-list ref] writes:
Yep, it very well is. Also, that approach would tell you which branch is
checked out, though I don't consider that git log's business.

OTOH, it's "backwards" in the sense that it marks the "ordinary" case
(HEAD is symref, branch is checked out) specially compared to the
"exceptional/dangerous" case (HEAD is ref, detached).
Both are ordinary and there is nothing exceptional or dangerous
about your HEAD temporarily being detached during a "rebase -i"
session, for example.
And status, branch
will point out that latter case more verbously, too.
Yeah, but as you said, that is not "log"'s business.

Re: Should "git log --decorate" indicate whether the HEAD is detached?

From: Michael J Gruber <hidden>
Date: 2016-06-15 23:03:51

Junio C Hamano venit, vidit, dixit 18.02.2015 20:49:
Michael J Gruber [off-list ref] writes:
quoted
Yep, it very well is. Also, that approach would tell you which branch is
checked out, though I don't consider that git log's business.

OTOH, it's "backwards" in the sense that it marks the "ordinary" case
(HEAD is symref, branch is checked out) specially compared to the
"exceptional/dangerous" case (HEAD is ref, detached).
Both are ordinary and there is nothing exceptional or dangerous
about your HEAD temporarily being detached during a "rebase -i"
session, for example.
Sure, that's why I put it in quotes. That's only how it is perceived by
some users, and I suppose it's that kind of users that we are trying to
help here.
quoted
And status, branch
will point out that latter case more verbously, too.
Yeah, but as you said, that is not "log"'s business.
I still think decorations "detached HEAD" resp. "HEAD" for the two cases
are more natural, if we want to include any additional information at
all. Just think of:

deadbeef (HEAD=master, topicbranch, tag: v1)

log/rev-list is about commit objects. All the refs above resolve to the
same commit, so why are only two of them equal?

In fact, they are very unequal, since HEAD would be "ref:
refs/heads/master" whereas master would "deadbeef". They are equal in
the other (detached) case! I'm not telling you any news here, I just
want to point out how badly misleading that notation is.

So, I would suggest to "decorate the decorations", by saying something
like "detached HEAD", and maybe some version of "HEAD at master" (I'd
prefer just "HEAD") and possibly more info on the tags ("s-tag" or
"signed tag" etc).

Michael
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help