Skip to content
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

Add sparse checkout support #772

Merged
merged 1 commit into from Dec 31, 2022

Conversation

pakrym
Copy link
Contributor

@pakrym pakrym commented Nov 25, 2021

Fixes: #771

Reads but does not interpret any of V1 extensions. The only one of interest is the worktreeConfig which I didn't implement because config.worktree didn't seem to contain any information of interest.

Sample sparse repo config:

config.worktree

[core]
	sparseCheckout = true

config

[core]
	repositoryformatversion = 1
	filemode = false
	bare = false
	logallrefupdates = true
	symlinks = false
	ignorecase = true
[remote "origin"]
	url = https://github.com/Azure/azure-sdk-for-net
	fetch = +refs/heads/*:refs/remotes/origin/*
	promisor = true
	partialclonefilter = tree:0
[branch "main"]
	remote = origin
	merge = refs/heads/main
[extensions]
	worktreeConfig = true

@pakrym
Copy link
Contributor Author

pakrym commented Nov 25, 2021

cc @tmat

@KalleOlaviNiemitalo
Copy link

How does GetUntrackedFiles work here if a tree is missing because of sparse checkout?

@pakrym
Copy link
Contributor Author

pakrym commented Nov 25, 2021

To be honest, I didn't know that feature existed.

If I understand how GetUntrackedFiles works, it might be a requirement for source link to clone .gitignore before building.

But for the files that are not gitingored it should work fine, the index is still there.

What do you think is the best course of action here?

@tmat
Copy link
Member

tmat commented Dec 6, 2021

Thanks for the PR. I'll need to find time to study the implications of this change before I can review.

@hcoona
Copy link

hcoona commented Sep 8, 2022

10 months passed, will this MR merge?

Copy link
Member

@tmat tmat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay.

@gitfool
Copy link

gitfool commented Oct 21, 2023

@tmat The github checkout action now supports partial checkout filters (actions/checkout#1396) and since this was merged can a new sourcelink package please be published to nuget to avoid breaking builds enabling partial checkout with:

error : Error reading git repository information: Unsupported repository version 1. Only versions up to 0 are supported.

🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support sparse checkout repositories
5 participants