Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FSMonitor: deepening a directory causes confusing events #443

Closed

Conversation

jeffhostetler
Copy link

See git-for-windows#3456

Pulling this forward into microsoft/git so that we can test it here too.

@jeffhostetler jeffhostetler self-assigned this Oct 11, 2021
@jeffhostetler jeffhostetler force-pushed the try-v4-fsmonitor-part5 branch 2 times, most recently from 78ffc22 to a7b7c45 Compare October 11, 2021 16:32
@jeffhostetler jeffhostetler force-pushed the try-v4-fsmonitor-part5 branch 2 times, most recently from 5be8f5c to 2a5a011 Compare October 12, 2021 13:36
@jeffhostetler
Copy link
Author

jeffhostetler commented Oct 12, 2021

The failure on windows-test (1) in t7527 step 56: Matrix[uc:true][fsm:false] move_directory is in the untracked-cache. It is turned on (and FSMonitor is off) and we are comparing the status output with the false/false case (where both are turned off).

I'm seeing a questionable entry in the untracked-cache when I dump it.

$ git -c core.usebuiltinfsmonitor=false status
warning: could not open directory 'T1/T3/': No such file or directory
On branch master
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        deleted:    T1/T2/T3/F1
        deleted:    T1/T2/T3/F2
        deleted:    T1/T2/T3/T4/F1
        deleted:    T1/T2/T3/T4/F2

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        T1/T2/NewT3/
        T1/T3/

no changes added to commit (use "git add" and/or "git commit -a")
$ ../helper/test-tool.exe dump-untracked-cache
info/exclude cc30ca8b9b10bb92f8e5c96ee94348c6c4ac93e6
core.excludesfile 0000000000000000000000000000000000000000
exclude_per_dir .gitignore
flags 00000006
/ 29bf0e0278da71c700d79b764e972e3ff0492d0f recurse valid
/T1/ 0000000000000000000000000000000000000000 recurse valid
T3/
/T1/T2/ 0000000000000000000000000000000000000000 recurse valid
/T1/T2/T3/ 0000000000000000000000000000000000000000 recurse valid
/T1/T2/T3/T4/ 0000000000000000000000000000000000000000 recurse valid
/T1/T3/ 0000000000000000000000000000000000000000 recurse
/dir1/ 0000000000000000000000000000000000000000 recurse valid
/dir2/ 0000000000000000000000000000000000000000 recurse valid
/dirtorename/ 0000000000000000000000000000000000000000 recurse valid

Why do we have a T3/ row?

Also, why are we getting that warning from git status?

The T1/T3 directory is left-over dirt from test 55 I believe.

@derrickstolee
Copy link

The failure on windows-test (1) in t7527 step 56: Matrix[uc:true][fsm:false] move_directory is in the untracked-cache. It is turned on (and FSMonitor is off) and we are comparing the status output with the false/false case (where both are turned off).

We know that the untracked cache is unreliable on Windows without the FS Monitor feature, but we have determined that it is reliable when we can count on the FS Monitor. Should we remove that possibility from the matrix?

@jeffhostetler
Copy link
Author

@derrickstolee Hey, is your #415 series (or parts of it) going upstream?

The failure I described above is fixed (or at least, not currently happening) when
I set GIT_FORCE_UNTRACKED_CACHE in the my t7527 test script (like was done
in t7063.

Also, I found the following upstream which I thought might be significant here.

cdda65a (Merge branch 'bp/untracked-cache-noflush', 2018-03-08)
026336c (untracked cache: use git_env_bool() not getenv() for customization, 2018-02-28)
fc9ecbe (dir.c: don't flag the index as dirty for changes to the untracked cache, 2018-02-05)

@jeffhostetler jeffhostetler force-pushed the try-v4-fsmonitor-part5 branch 2 times, most recently from a89e24f to ee44d7d Compare October 12, 2021 21:13
@derrickstolee
Copy link

@derrickstolee Hey, is your #415 series (or parts of it) going upstream?

I should probably send 7e993e5 upstream for feedback.

The failure I described above is fixed (or at least, not currently happening) when I set GIT_FORCE_UNTRACKED_CACHE in the my t7527 test script (like was done in t7063.

Interesting. My change makes core.untrackedCache=true behave as if GIT_FORCE_UNTRACKED_CACHE=1. Since your setup sets core.untrackedCache=true and calls git update-index --untracked-cache, there should be no change from #415.

@jeffhostetler jeffhostetler force-pushed the try-v4-fsmonitor-part5 branch from ee44d7d to 6193af1 Compare October 13, 2021 14:04
@jeffhostetler
Copy link
Author

The more I tinker with this, the more I think we still haven't found the real problem.
Adding FORCE made some runs succeed, but others still failed. I want to take
some time (not today) and dig into the untracked-cache code on Windows and see
what's really going on.

Create unit tests to move a directory.  Verify that `git status`
gives the same result with and without FSMonitor enabled.

NEEDSWORK: This test exposes a bug in the untracked-cache on
Windows when FSMonitor is disabled.  These are commented out
for the moment.

Signed-off-by: Jeff Hostetler <[email protected]>
@jeffhostetler
Copy link
Author

I'm going to close this PR and replace it with #448 to (hopefully) cause a complete set of fresh builds.

auto-merge was automatically disabled October 13, 2021 22:04

Pull request was closed

@jeffhostetler jeffhostetler deleted the try-v4-fsmonitor-part5 branch June 21, 2023 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants