From: Junio C Hamano <gitster@pobox.com>
To: M Hickford <mirth.hickford@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Feature request: status could list ref names after "HEAD detached"
Date: Thu, 21 Mar 2024 12:20:00 -0700 [thread overview]
Message-ID: <xmqq5xxf8k9r.fsf@gitster.g> (raw)
In-Reply-To: <CAGJzqs=ULaHwttY1jRaW4ZT0tGeSW2S_gcEw=tMrY+i26Jy1gA@mail.gmail.com> (M. Hickford's message of "Thu, 21 Mar 2024 08:00:00 +0000")
M Hickford <mirth.hickford@gmail.com> writes:
> I frequently run `git status`. Sometimes HEAD is detached:
>
> HEAD detached at ea601b57e
>
> It would be neat to include ref names here, similar to git log:
>
> HEAD detached at ea601b57e (origin/main, origin/HEAD, main)
>
> This gives me more information before I create a new branch or switch branch.
This has already moved away from the original "I want to know on
which branch other worktrees are working" feature, but while we are
expanding the edges...
I wonder what you want to see when a detached HEAD deviated from its
initial position (i.e., when we say "HEAD detached from", not "HEAD
detached at", in "git status" output). Would we still want to show
the "--decorate" list of existing refs for the original position?
$ git checkout --detach master
$ git status | head -n1
HEAD detached at 3bd955d269
$ git checkout --allow-empty -m empty
$ git status | head -n1
HEAD detached from 3bd955d269
$ git reset --hard HEAD^
$ git status | head -n1
HEAD detached at 3bd955d269
If we add "(master)" after 3bd955d269 in the above illustration, I
wonder if it makes it too misleading.
next prev parent reply other threads:[~2024-03-21 19:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-21 8:00 Feature request: status could list ref names after "HEAD detached" M Hickford
2024-03-21 19:20 ` Junio C Hamano [this message]
2024-03-22 15:00 ` M Hickford
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq5xxf8k9r.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=mirth.hickford@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).