问题
As git is increasingly advertised (and enhanced) to better support very large repositories (so-called "monorepos"), with major recent enhancements to the sparse-checkout workflow (git-sparse-checkout command and partial clone / promisors / --filter), I'm surprised that I can't find a way to leverage the sparse-checkout configuration/specification when dealing with commit history.
I see that the topic has been partially brought up in previous questions:
- filter git commit history after sparse checkout
- git log filter with sparse checkout
The only answers propose per-command path filters, but converting the .git/info/sparse-checkout
specification to path filters will often be non-trivial if not impossible.
The lack of sparse-checkout support seems particularly problematic with git-diff, where on a large monorepo the differences between two reasonably-distant versions of the repo might be substantially obscured, or effectively unreachable, due to all other teams'/areas' updates. This is both a performance concern, and a readability/reachability/usability concern.
Does anyone know whether using sparse-checkout configuration in diff and other tools is possible, and/or whether such a possibility is in the works?
来源:https://stackoverflow.com/questions/61326025/git-and-sparse-checkout-on-large-monorepos-hiding-irrelevant-changes-for-a-spa