-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Sparse Checkout #6394
base: main
Are you sure you want to change the base?
Sparse Checkout #6394
Conversation
…ile diffing Signed-off-by: Jochen Hunz <j.hunz@anchorpoint.app>
…used by sparse checkout code as well Signed-off-by: Jochen Hunz <j.hunz@anchorpoint.app>
Signed-off-by: Jochen Hunz <j.hunz@anchorpoint.app>
The sparse-checkout file is treated as a git_attr_file. A public API git_sparse_check_path reads the sparse-checkout file from the attribute file cache and checks the path against this attribute file using the gitignore ruleset Signed-off-by: Jochen Hunz <j.hunz@anchorpoint.app>
…ed git_sparse object Signed-off-by: Jochen Hunz <j.hunz@anchorpoint.app>
…es that are excluded by the sparse checkout ruleset - if sparse checkout is enabled Signed-off-by: Jochen Hunz <j.hunz@anchorpoint.app>
Signed-off-by: Jochen Hunz <j.hunz@anchorpoint.app>
…arse Signed-off-by: Jochen Hunz <j.hunz@anchorpoint.app>
…accessed by checkout and diff functionalities quickly. Signed-off-by: Jochen Hunz <j.hunz@anchorpoint.app>
Signed-off-by: Jochen Hunz <j.hunz@anchorpoint.app>
…heckout Signed-off-by: Jochen Hunz <j.hunz@anchorpoint.app>
Signed-off-by: Jochen Hunz <j.hunz@anchorpoint.app>
…ries Signed-off-by: Jochen Hunz <j.hunz@anchorpoint.app>
Signed-off-by: Jochen Hunz <j.hunz@anchorpoint.app>
Signed-off-by: Jochen Hunz <j.hunz@anchorpoint.app>
- Temporarily remove cone references, will need to revisit - Updating references in tests
seems we've run out of space on that enum...
6958e3f
to
4224906
Compare
This PR seems really promising with lots of people wanting sparse-checkout support. Not just directly from the libgit2 community (#2263), but also from all of the other projects that are built with libgit2. Are there any particular blockers for merging this? The last update seems to be from 8 months ago. |
@YuKitsune @jochenhz Can you comment on the status of the sparse-checkout branch? It seems like work was done on it 1 or 2 years ago and it's not been pulled back into the main libgit2 repo. I tried using it to read a sparse repo and it failed during reading the index. Is it known to work? Are there known issues/limitations? |
This PR aims to implement basic sparse checkout functionality into LibGit2 building on @jochenhz's original PR.
What does it do?
sparse-checkout
file is treated as anattr_file
, hence followinggitignore
rulescore.sparseCheckout
init
,set
,add
,reapply
anddisable
commands all supportedgit_sparse_check_path
to query whether or not a file is excluded from checkoutGIT_INDEX_ENTRY_SKIP_WORKTREE
flag ongit_index_read_tree
based on the sparse checkout ruleset.What does it not do?
core.sparseCheckoutCone
GIT_CHECKOUT_NONE
andgit_index_read_tree
)Note