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

Sparse Checkout #405

Open
meatballs opened this issue Jan 14, 2016 · 10 comments
Open

Sparse Checkout #405

meatballs opened this issue Jan 14, 2016 · 10 comments

Comments

@meatballs
Copy link

Implement the sparse checkout functionality described at:
http://schacon.github.io/git/git-read-tree.html#_sparse_checkout

i.e. if config.core.sparsecheckout = true, then only checkout files which match the patterns listed in the file .git/info/sparse-checkout

@meatballs
Copy link
Author

How about the following:

  • Add list parameters match_patterns and ignore_patterns to index.build_index_from_tree which can be used to pass unix style file pattern matches. The parameters would have a default value of None
  • Create a new file path validator which uses the fnmatch module to match against the pattern parameters

@meatballs
Copy link
Author

I'm happy to pick this one up once we agree on the way forward!

@jelmer
Copy link
Owner

jelmer commented Jan 18, 2016

On Fri, Jan 15, 2016 at 01:57:27AM -0800, Owen Campbell wrote:

How about the following:

  • Add list parameters match_patterns and ignore_patterns to index.build_index_from_tree which can be used to pass unix style file pattern matches. The parameters would have a default value of None
    The syntax of these is the same as for gitignore files. I would suggest passing in a Matcher object which can be constructed from a .gitignore or .git/info/sparse-checkout file.
  • Create a new file path validator which uses the fnmatch module to match against the pattern parameters
    This is essentially the matcher mentioned above.

You'll probably also need to touch the index object to allow setting the skip-workingtree bit.

Cheers,

Jelmer

@jelmer
Copy link
Owner

jelmer commented Jan 18, 2016

On Mon, Jan 18, 2016 at 12:51:14PM +0000, Jelmer Vernooij wrote:

On Fri, Jan 15, 2016 at 01:57:27AM -0800, Owen Campbell wrote:

How about the following:

  • Add list parameters match_patterns and ignore_patterns to index.build_index_from_tree which can be used to pass unix style file pattern matches. The parameters would have a default value of None
    The syntax of these is the same as for gitignore files. I would suggest passing in a Matcher object which can be constructed from a .gitignore or .git/info/sparse-checkout file.
  • Create a new file path validator which uses the fnmatch module to match against the pattern parameters
    This is essentially the matcher mentioned above.

You'll probably also need to touch the index object to allow setting the skip-workingtree bit.
See also http://schacon.github.io/git/git-read-tree.html#_sparse_checkout

@meatballs
Copy link
Author

I would suggest passing in a Matcher object

What module contains that class?

@jelmer
Copy link
Owner

jelmer commented Jan 19, 2016

On Tue, Jan 19, 2016 at 05:15:22AM -0800, Owen Campbell wrote:

I would suggest passing in a Matcher object

What module contains that class?
Such a class would have to be added. I'd rather not depend on an external
package for this kind of functionality, it shouldn't be too hard to implement
in Dulwich itself.

Cheers,

Jelmer

@akbargumbira
Copy link
Contributor

Hi, just wanted to check, is sparse checkout already possible with dulwich?

@jelmer
Copy link
Owner

jelmer commented Jun 8, 2016

Ish. The support is there on the networking side, but there is no porcelain that can use it to set up a sparse checkout.

On 8 June 2016 13:54:24 BST, Akbar Gumbira notifications@github.com wrote:

Hi, just wanted to check, is sparse checkout already possible with
dulwich?


You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#405 (comment)

Sent from my Android device with K-9 Mail. Please excuse my brevity.

@agurtovoy
Copy link

Hey @jelmer, do I understand correctly that it's technically possible to implement sparse checkout through dulwich, but it's verbose/complicated?

@jelmer
Copy link
Owner

jelmer commented May 11, 2021

@agurtovoy Pretty much. Any patches that added support to porcelain for sparse checkouts would be awesome, though you could probably also get sparse checkout support by manually calling out to some of the lower layers without modifying dulwich.

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

No branches or pull requests

4 participants