Skip to content

status: improve info for detached HEAD

Roy Eldar git 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v1 Latest posting 2/22 patches 2 repliesIn review
  2. v1 RFC posting 1/22 patches 0 repliesSuperseded

Patches in v1 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2t7508: test status output for detached HEAD after clonet/t7508-status.sh+12 -00 replies
2/2status: improve info for detached HEAD after clonet/t7508-status.sh wt-status.c+8 -12 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH RESEND 0/2] status: improve info for detached HEAD

When a repository is cloned using "git clone -b" and a tag is specified, HEAD is automatically detached. As a result, "git status" shows "currently not on any branch", which is not very useful.

Teach "git status" to generate the "HEAD detached at" message in this case as well, in a similar way to when a tag is checked out.

In the case of "git checkout", the name of the ref that was checked out is retrieved from the reflog; for "git clone", the name of the ref isn't present in the reflog entry, so we use the abbreviated hash instead. This is also consistent with the "detached HEAD" advice.

Roy Eldar (2):
t7508: test status output for detached HEAD after clone
status: improve info for detached HEAD after clone

 t/t7508-status.sh | 12 ++++++++++++
 wt-status.c       |  7 +++++++
 2 files changed, 19 insertions(+)
Signature · 1 line
2.30.2