Add --sparse-paths for sparse checkout feature#75
Conversation
3e153c3 to
1ee1e73
Compare
| if sparse_paths | ||
| clone_commands << mirror.to_s << clone_dest | ||
| else | ||
| clone_commands << '--reference' << mirror.to_s << url.to_s << clone_dest |
There was a problem hiding this comment.
if i do a full checkout then do it again with sparse checkout on the same clone_dest, what happens? for example will just one path get new updated version based on the branch, where the rest are the old version?
There was a problem hiding this comment.
If the same clone destination already exists, then git-fastclone won't do the clone – that's how it already works. I think this is still the right way to handle things, rather than trying to deal with possibly updating an existing clone.
Example of doing two different checkouts of the same already-cached repo:
$ rm -rf bazel-sparse && be git fastclone --sparse-paths .bazelci -b master https://github.com/bazelbuild/bazel bazel-sparse; rm -rf bazel-full && be git fastclone -b master "https://github.com/bazelbuild/bazel" bazel-full
git-fastclone 1.6.0
Cloning bazel to /Users/tsutton/Development/git-fastclone/bazel-sparse
Checkout of bazel-sparse took 0.84033s
git-fastclone 1.6.0
Cloning bazel to /Users/tsutton/Development/git-fastclone/bazel-full
Checkout of bazel-full took 2.324625s
There was a problem hiding this comment.
right that makes total sense, i guess another small issue is if whoever used the new feature want to know if the checkout is full or not... but that's up to them to decide anyway
| # Version string for git-fastclone | ||
| module GitFastCloneVersion | ||
| VERSION = '1.5.1' | ||
| VERSION = '1.6.0' |
There was a problem hiding this comment.
we don't have changelog.md huh
There was a problem hiding this comment.
hehe no, I looked for the same thing
lib/git-fastclone.rb
Outdated
|
|
||
| clone_commands = ['git', 'clone', verbose ? '--verbose' : '--quiet'] | ||
| clone_commands << '--reference' << mirror.to_s << url.to_s << clone_dest | ||
| clone_commands.push('--no-checkout') if sparse_paths |
There was a problem hiding this comment.
nit: move this line to line 259
1ee1e73 to
3adc633
Compare
a2173a1 to
aaff7b3
Compare
Introduce
--sparse-pathsfeature to allow sparse checkout.The purpose for this option is to tell
git-fastcloneto set up a sparse-checkout instead of a regular one, still using its reference dir as the source for the clone. It doesn't allow any additional configuration of the sparse checkout besides a list of paths, at this point.It might be that in a future version we want to improve how this option works to allow more configuration, too.
We may need #76 merged first to get CI into a healthy state.