Open rossnichols opened 2 months ago
@rossnichols does this also happen if you use the (correct) spelling HEAD~1
(instead of the lower-case head~1
, which is known to cause problems)?
@dscho I seem to have lost the repro right now, even on new clones :(. I haven't figured out how to transition from working to broken, only broken to working (the dehydrate commands) - doing gvfs prefetch --hydrate ...
doesn't seem to go back to broken).
All I can add, though, is that using VSCode's GUI to transition between staged and unstaged was also susceptible to this, though I don't know the commands it runs under the hood.
I'll see if I can get the repro again.
git-for-windows/git
tracker.Setup
microsoft/git
are you using? Is it 32-bit or 64-bit?Are you using Scalar or VFS for Git?
GVFS
If VFS for Git, then what version?
I'm reproing this issue in the Windows monorepo.
Details
PowerShell 7.4.5
I expected to continue to see 44 modified files, just unstaged instead of staged.
Git lost track of some unstaged files.
If the problem was occurring with a specific repository, can you specify the repository?
This issue has been previously reported via #490 and #646. The fix does not yet seem complete, though - every time I cherry-pick a commit and run
git reset --mixed head~1
to go through it and make updates, I risk losing files.Note that first running the soft reset is NOT a prerequisite to repro - I only performed it to demonstrate the discrepancy. However, having some amount of hydrated files IS a prerequisite (hence launching razzle to simply trigger it going off and hydrating files on the new repo).
The bug does NOT repro in a given directory if I explicitly dehydrate the directory that contains a "lost" file. For example, if file "foo/bar/baz.cpp" was lost, and I
reset --hard
back to the original commit, then runninggvfs dehydrate i:\os1\src --confirm --folders "foo/bar"
before tryinggit reset --mixed head~1
will fix that file. Similarly, runninggvfs dehydrate --confirm
to dehydrate everything also makes the repro go away completely.It's also worth calling out that if I browse to a "lost" file, the expected changes are present, and if I save the file (e.g. after making a modification and undoing it), git now tracks the expected changes. Simply opening the file is insufficient to fix it (git will continue to overlook it), I have to resave it. Once it's fixed, it remains fixed if I repeat the repro steps. Similarly, if I open and save a file before performing the mixed reset, it will not be lost.
So overall, it seems to impact files that have not been edited locally (even if they've been viewed), but whose directories have been hydrated. At least, that's what my experimentation seems to show.
@derrickstolee FYI.