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 #3456

Merged
merged 3 commits into from
Oct 13, 2021

Conversation

jeffhostetler
Copy link

Moving a directory can cause confusion. Items immediately within the directory are invalidated and re-scanned, but deeper items are not. This causes stale/confusing status to be reported.

Copy link
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Do we want to rename the first commit to be a proper fixup! commit?

@jeffhostetler
Copy link
Author

I suppose I should make it a proper "fixup!" commit. Let me give that a try.

@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
Copy link
Author

This fails on Windows because we do not get trailing slashes on events and cannot tell whether a path is a file or directory in the daemon callback. So the code in the client that marks everything in the cone needs to be revisited.

@jeffhostetler jeffhostetler force-pushed the try-v4-fsmonitor-part5 branch from a7b7c45 to 5be8f5c Compare October 11, 2021 21:54
@jeffhostetler jeffhostetler force-pushed the try-v4-fsmonitor-part5 branch from 5be8f5c to 2a5a011 Compare October 12, 2021 13:36
@jeffhostetler jeffhostetler force-pushed the try-v4-fsmonitor-part5 branch 2 times, most recently from a89e24f to ee44d7d Compare October 12, 2021 21:13
@dscho
Copy link
Member

dscho commented Oct 13, 2021

I am still seeing this:

diff --git a/.git/expect.move_directory b/.git/actual.move_directory
index 187ce8c..3fbacd0 100644
--- a/.git/expect.move_directory
+++ b/.git/actual.move_directory
@@ -3,3 +3,4 @@
  D T1/T2/T3/T4/F1
  D T1/T2/T3/T4/F2
 ?? T1/T2/NewT3/
+?? T1/T3/
error: last command exited with $?=1
not ok 56 - Matrix[uc:true][fsm:false] move_directory

(The same failure happens in the vs-test axes)

Now, the biggest complication is: Git v2.33.1 was released yesterday, without much in the way of warning (at least that I was aware of). I had hoped to stabilize FSMonitor in Git for Windows before the next Git for Windows release...

@dscho dscho mentioned this pull request Oct 13, 2021
@jeffhostetler
Copy link
Author

WRT the test failures, yeah, I'm still tinkering with the tests. It's in the untracked-cache and not the fsmonitor code, so perhaps I've accidentally created a test for the untracked-cache on Windows. I'm going to take another look at this, but might just decide to split the code and close the fsmonitor-related stuff here and create another issue/pr to look at the untracked-cache.

@jeffhostetler jeffhostetler force-pushed the try-v4-fsmonitor-part5 branch from ee44d7d to 6193af1 Compare October 13, 2021 14:04
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 jeffhostetler force-pushed the try-v4-fsmonitor-part5 branch from 6193af1 to 4c3206e Compare October 13, 2021 14:11
@dscho dscho added this to the v2.33.1 milestone Oct 13, 2021
@dscho
Copy link
Member

dscho commented Oct 13, 2021

Yay, the build succeeded!!! I'll only wait for a moment until the current snapshot has been built, and then merge this.

dscho added a commit that referenced this pull request Feb 15, 2022
FSMonitor: deepening a directory causes confusing events
dscho added a commit that referenced this pull request Feb 15, 2022
FSMonitor: deepening a directory causes confusing events
dscho added a commit that referenced this pull request Feb 15, 2022
FSMonitor: deepening a directory causes confusing events
dscho added a commit that referenced this pull request Feb 15, 2022
FSMonitor: deepening a directory causes confusing events
dscho added a commit that referenced this pull request Feb 17, 2022
FSMonitor: deepening a directory causes confusing events
dscho added a commit that referenced this pull request Feb 17, 2022
FSMonitor: deepening a directory causes confusing events
dscho added a commit that referenced this pull request Feb 21, 2022
FSMonitor: deepening a directory causes confusing events
dscho added a commit that referenced this pull request Feb 21, 2022
FSMonitor: deepening a directory causes confusing events
dscho added a commit that referenced this pull request Feb 22, 2022
FSMonitor: deepening a directory causes confusing events
dscho added a commit that referenced this pull request Feb 22, 2022
FSMonitor: deepening a directory causes confusing events
dscho added a commit that referenced this pull request Feb 22, 2022
FSMonitor: deepening a directory causes confusing events
dscho added a commit that referenced this pull request Feb 24, 2022
FSMonitor: deepening a directory causes confusing events
dscho added a commit that referenced this pull request Feb 24, 2022
FSMonitor: deepening a directory causes confusing events
dscho added a commit that referenced this pull request Mar 1, 2022
FSMonitor: deepening a directory causes confusing events
dscho added a commit that referenced this pull request Mar 1, 2022
FSMonitor: deepening a directory causes confusing events
dscho added a commit that referenced this pull request Mar 2, 2022
FSMonitor: deepening a directory causes confusing events
dscho added a commit that referenced this pull request Mar 7, 2022
FSMonitor: deepening a directory causes confusing events
dscho added a commit that referenced this pull request Mar 9, 2022
FSMonitor: deepening a directory causes confusing events
dscho added a commit that referenced this pull request Mar 9, 2022
FSMonitor: deepening a directory causes confusing events
dscho added a commit that referenced this pull request Mar 10, 2022
FSMonitor: deepening a directory causes confusing events
dscho added a commit that referenced this pull request Mar 14, 2022
FSMonitor: deepening a directory causes confusing events
dscho added a commit that referenced this pull request Mar 15, 2022
FSMonitor: deepening a directory causes confusing events
dscho added a commit that referenced this pull request Mar 15, 2022
FSMonitor: deepening a directory causes confusing events
dscho added a commit that referenced this pull request Mar 17, 2022
FSMonitor: deepening a directory causes confusing events
git-for-windows-ci pushed a commit that referenced this pull request Mar 22, 2022
FSMonitor: deepening a directory causes confusing events
git-for-windows-ci pushed a commit that referenced this pull request Mar 23, 2022
FSMonitor: deepening a directory causes confusing events
dscho added a commit that referenced this pull request Mar 30, 2022
FSMonitor: deepening a directory causes confusing events
dscho added a commit that referenced this pull request Apr 4, 2022
FSMonitor: deepening a directory causes confusing events
derrickstolee pushed a commit to microsoft/git that referenced this pull request Apr 12, 2022
…onitor-part5

FSMonitor: deepening a directory causes confusing events
@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.

4 participants