Skip to content

fix(cache): skip .git in directory listings - #903

Open
jasonkuhrt wants to merge 2 commits into
voidzero-dev:mainfrom
jasonkuhrt:fix/fingerprint-ignore-git-entry
Open

jasonkuhrt wants to merge 2 commits into
voidzero-dev:mainfrom
jasonkuhrt:fix/fingerprint-ignore-git-entry

Conversation

@jasonkuhrt

Copy link
Copy Markdown
Contributor

Closes #902

Motivation

A task that lists a directory records each entry's name and kind. .git is a directory in an ordinary checkout and a file in a git worktree, so a task that lists the workspace root never replays between the two, though every file it can read is the same. The miss reads ○ cache miss: '.git' added in workspace root. In #902, a fresh worktree at our trunk's head missed 56 vp lint entries that CI, checking out with a .git directory, had recorded for that commit.

Change

should_ignore_entry now skips .git, as it skips .DS_Store and dist. Reads under .git are already left out of the fingerprint by tracked_accesses.rs, so this brings listings in line with reads. Like the other names, it applies to listings at any depth, which also covers a git submodule, whose .git is a file too.

The new e2e case git_worktree_listing runs a task that lists the workspace root with .git as a directory, replaces it with a worktree's .git file, and runs the task again. On main the second run misses with '.git' added in workspace root; with this change it replays.

A task that lists a directory records each entry's name and kind. `.git`
is a directory in an ordinary checkout and a file in a `git worktree`, so
a task that lists the workspace root never replayed between the two,
though every file it could read was the same:

    ○ cache miss: '.git' added in workspace root

Reads under `.git` are already left out of the fingerprint. Leave the
entry out of listings too, as `.DS_Store` and `dist` are.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

read-write overlap Caching tasks that read and write the same paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A git worktree never replays a checkout's cache entry for a task that lists the workspace root

2 participants