{"thread":{"id":"58735","subject":"bug report for \"git status\"","startedAt":"2022-11-02T15:11:23Z","lastAt":"2022-11-02T15:11:23Z","messageCount":1,"participants":["Stephen Loftus-Mercer"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"466317","messageId":"84cd66d955ed4188aad093cc306080d0@spacex.com","threadId":"58735","inReplyTo":null,"subject":"bug report for \"git status\"","fromName":"Stephen Loftus-Mercer","fromEmail":"stephen.loftus-mercer@spacex.com","sentAt":"2022-11-02T15:06:17Z","receivedAt":"2022-11-02T15:11:23Z","isPatch":false,"sender":{"key":"stephen.loftus-mercer@spacex.com","avatar":null},"body":"Thank you for filling out a Git bug report!\nPlease answer the following questions to help us understand your issue.\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\nTwo git commands that should be identical produce different results. \n\nFirst command:\n> git worktree add -d \"c:\\temp\\junk\\blah\" 209134fc8f\n> git status\n\nSecond command:\n> git worktree add -d \"c:\\temp\\junk\\blah\"\n> cd \"c:\\temp\\junk\\blah\"\n> git checkout 209134fc8f\n> git status\n\nFull details discussed here:\nhttps://stackoverflow.com/questions/74237452/why-is-there-a-difference-between-git-worktree-add-with-checkout-and-git-chec/74241950\n\nWhat did you expect to happen? (Expected behavior)\nI expected both \"git status\" calls to be identical results. They are not. \n\nI expected that both would output the following:\n> c:\\temp\\junk\\blah>git status\n> HEAD detached at 209134fc8f\n> nothing to commit, working tree clean\n\n\nWhat happened instead? (Actual behavior)\nThe first worktree command, the one with the commit hash in the command, gave this status instead:\n> c:\\temp\\junk\\blah>git status\n> Not currently on any branch.\n> nothing to commit, working tree clean\n\nWhat's different between what you expected and what actually happened?\nI do not understand why the first command has no head. Worse, why does it have no commit listed at all? \nClearly HEAD must be on *some* commit -- my workspace is synced to some set of files!. \n\nAnything else you want to add:\nThe 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. \n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.36.1.windows.1\ncpu: x86_64\nbuilt from commit: e2ff68a2d1426758c78d023f863bfa1e03cbc768\nsizeof-long: 4\nsizeof-size_t: 8\nshell-path: /bin/sh\nfeature: fsmonitor--daemon\nuname: Windows 10.0 19044 \ncompiler info: gnuc: 11.3\nlibc info: no libc information available\n$SHELL (typically, interactive shell): <unset>\n\n\n[Enabled Hooks]\n"}]}