bug report for "git status"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)
Two git commands that should be identical produce different results. 

First command:
> git worktree add -d "c:\temp\junk\blah" 209134fc8f
> git status

Second command:
> git worktree add -d "c:\temp\junk\blah"
> cd "c:\temp\junk\blah"
> git checkout 209134fc8f
> git status

Full details discussed here:
https://stackoverflow.com/questions/74237452/why-is-there-a-difference-between-git-worktree-add-with-checkout-and-git-chec/74241950

What did you expect to happen? (Expected behavior)
I expected both "git status" calls to be identical results. They are not. 

I expected that both would output the following:
> c:\temp\junk\blah>git status
> HEAD detached at 209134fc8f
> nothing to commit, working tree clean


What happened instead? (Actual behavior)
The first worktree command, the one with the commit hash in the command, gave this status instead:
> c:\temp\junk\blah>git status
> Not currently on any branch.
> nothing to commit, working tree clean

What's different between what you expected and what actually happened?
I do not understand why the first command has no head. Worse, why does it have no commit listed at all? 
Clearly HEAD must be on *some* commit -- my workspace is synced to some set of files!. 

Anything else you want to add:
The Stack Overflow post gives a reasonable explanation of why this happens. I think the difference is irrelevant to most users. I would prefer that both commands result in the same result. If that is impossible, I would ask that at least the "git status" command be amended to ALWAYS include a commit hash since that's the primary way to figure out which files are currently synched in a directory. 

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.36.1.windows.1
cpu: x86_64
built from commit: e2ff68a2d1426758c78d023f863bfa1e03cbc768
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
uname: Windows 10.0 19044 
compiler info: gnuc: 11.3
libc info: no libc information available
$SHELL (typically, interactive shell): <unset>


[Enabled Hooks]




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux