Open meatballs opened 8 years ago
How about the following:
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
I'm happy to pick this one up once we agree on the way forward!
On Fri, Jan 15, 2016 at 01:57:27AM -0800, Owen Campbell wrote:
How about the following:
- Add list parameters
match_patterns
andignore_patterns
toindex.build_index_from_tree
which can be used to pass unix style file pattern matches. The parameters would have a default value ofNone
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
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
andignore_patterns
toindex.build_index_from_tree
which can be used to pass unix style file pattern matches. The parameters would have a default value ofNone
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
I would suggest passing in a Matcher object
What module contains that class?
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
Hi, just wanted to check, is sparse checkout already possible with dulwich?
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: https://github.com/jelmer/dulwich/issues/405#issuecomment-224579678
Sent from my Android device with K-9 Mail. Please excuse my brevity.
Hey @jelmer, do I understand correctly that it's technically possible to implement sparse checkout through dulwich, but it's verbose/complicated?
@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.
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