dolt icon indicating copy to clipboard operation
dolt copied to clipboard

Shallow clone/Partial Clone

Open aleclarson opened this issue 3 years ago • 1 comments

In cases where commit history is unnecessary, it'd be nice to avoid the wasted disk space.

dolt clone --depth 1 <repo> <dest>

From git docs: image

aleclarson avatar May 12 '22 20:05 aleclarson

We've definitely discussed this and agree it's a good feature to add.

timsehn avatar May 12 '22 21:05 timsehn

I think shallow clones and partial clones are a bit different features (although with some overlap). It's been discussed in pretty much any version control system implementation that ever existed, and sometimes they call them by different names (narrow clones, slices, etc.), but in the end it's all about the same.

Basically it all boils down to limit the clone in two dimensions: time and space.

So, time is what Git calls shallow clone, which lets you clone the repository without having to clone the full history.

And space, is what Git calls sparse checkout, which lets you checkout (and possible clone) only those parts of the repository that you are interested about. For example only a specific directory (or specific table in Dolt).

Both features are indeed very valuable to have in Dolt.

Do you have any plans, or maybe rough ideas on how could this be implemented in Dolt?

burdiyan avatar Feb 10 '23 14:02 burdiyan

Bumping this. This would be such a time saver for data bounties. These people don't need the history ever.

alecstein avatar Apr 08 '23 12:04 alecstein

Shallow clone is implemented:

https://www.dolthub.com/blog/2024-02-21-shallow-clone/

Partial clones are not. Changing the title of this issue to Partial :-)

timsehn avatar Feb 28 '24 23:02 timsehn

This issue was asking for shallow clones, maybe would be better to close this one as implemented and create a new one for tracking sparse checkouts?

burdiyan avatar Feb 29 '24 15:02 burdiyan

Good idea.

timsehn avatar Feb 29 '24 16:02 timsehn

@burdiyan , we'd love to learn about your Dolt use case sometime. Feel free to join our Discord or shoot me an email if you want to share.

bpf120 avatar Feb 29 '24 20:02 bpf120