You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9a95c5f
Browse filesBrowse the repository at this point in the historyBrowse files
Prove excluded-file records only with rules the walk applies
An excluded-file record lets the watcher drop an unchanged notification
for a tracked file the walk did not list. A record is made only when the
pass's matcher proves the file excluded, so the matcher must not exclude
a file the walk would list. It could in three cases.
Below a nested repository, the walk stops applying the outer
repository's `.gitignore` and `info/exclude` rules, while the matcher
still applies them. A tracked file there that was absent during the walk
and restored before the records were built could get a record although
the next walk lists it. If its create notification was missed, a later
notification that left it unchanged was dropped, although the published
state did not contain the file. Records now skip every directory below
the root that holds an entry named `.git` or `.jj`, of any type and in
any ASCII case, or whose listing fails partway. The walk treats a
directory as another repository only when a lookup of `.git` or `.jj`
there finds an entry, and never with `--no-require-git`. Unless the file
system equates another name with those beyond ASCII case, this skips at
least every subtree the walk treats as one, and skipping only removes
records. A listing can return the marker after other entries, so the
records and queued subdirectories already taken from that directory are
then released.
Neither exclude file proves exclusion any more. The metadata walk never
sets the walker's working directory, so it matches global patterns
relative to the process's working directory, while the matcher roots
them at the view root. An anchored global pattern could therefore
exclude a file in the matcher that the walk lists. Behind a `.git` file,
the walk applies the repository's `info/exclude` only when Git is
required and the pointer, resolved against the process's working
directory, leads to a Git directory with a `commondir` file. The matcher
resolves a relative pointer against the directory holding `.git`, and
takes a Git directory without `commondir`, such as a submodule's or a
`--separate-git-dir` checkout's, as its own common directory, so it
applied `info/exclude` where the walk did not. Both files have the
lowest precedence of the standard rules, and the p4ignore and case
filters don't read the standard decision, so leaving them out of the
proof only removes exclusions and stays safe however the walk resolves
them. When Git ignores case, the case filter still matches
`info/exclude`'s rules, but it never hides a tracked file, and the walk
applies the same filter. Tracked files that only an exclude file
excludes get no record and keep invalidating, as in 1.2.6. Outside
nested repositories, records proven by `.gitignore`, `.ignore` or the
p4ignore filter are unchanged, as are the walk, visibility and
whitelists.
The tests remove tracked files before the walk and restore them before
the records are built, with the walk's matcher and with a rebuilt one, an
injected matcher whose only proof is global, a daemon whose global
excludes file holds anchored and unanchored patterns, and `info/exclude`
behind a `.git` directory, a separate Git directory and a linked
worktree's relative pointer.
Co-authored-by: Copilot App <[email protected]>
0 commit comments