Repository navigation
Conversation
The repo root is the nearest .git above each entry point project. When a solution of a superproject also contains projects of one of its submodules, those projects find the .git file of the submodule, so the graph has two repo roots and the cache was disabled. The file hashes of a repo root already include the files of its initialized submodules (git submodule status --recursive). So when every other repo root is an initialized submodule of one of them, that superproject is now the repo root. Repo roots which are not nested, and nested repositories which are not initialized submodules, still disable the cache. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GetRepoRoottakes the nearest.gitabove each entry point project. When a solution of a superproject also contains projects of one of its git submodules, those projects find the submodule's.gitfile first. The graph then has two repo roots, and the plugin disables the cache:The file hashes already support submodules:
GitFileHashProviderlists the initialized submodules withgit submodule status --recursive, hashes their files, and replaces the gitlink entry with them. Only the choice of the repo root stops them from being used.With this change, when every other repo root is an initialized submodule of one of them, that superproject is the repo root. Paths in fingerprints are then relative to the superproject. The cache stays disabled, as today, for repo roots that are not nested in one another, and for a nested repository that is not an initialized submodule (e.g. a clone inside the working tree), whose files the superproject's hashes would not cover.
We use it for a repository that consumes another one as a submodule: its solution (64 graph nodes, part of them in the submodule) went from the warning above, and no caching, to 64/64 hits on warm CI builds, ~300 s → ~65 s per job.
Tests:
MSBuildCachePluginBaseTestscovers a superproject with a submodule, with a nested submodule (a/bas listed bygit submodule status --recursive), a nested repository that is not a submodule, and unrelated roots, including a sibling whose path starts with the same characters.🤖 Generated with Claude Code