Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Shallow clone using JGit

Support for shallow clones is coming along bit by bit I think - JGit can now serve shallow clones (ie when used in server mode) and apparently RevWalk now supports traversing shallow clones:

http://wiki.eclipse.org/JGit/New_and_Noteworthy/2.2#RevWalk_support_for_shallow_clones

However, I don't think the JGit library currently supports doing a shallow clone as a client - if you look at the JGit CloneCommand, there's no sign of it:

https://github.com/eclipse/jgit/blob/v2.2.0.201212191850-r/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java

I used to miss this feature too, but I've come to be less convinced of it's use - what do you feel it's useful for? For a reasonably 'sane' repo (one that has slowly grown over time) the brilliant packfile storage format means that saving on transmitted data (between shallow and non-shallow) is often less than 10% - so is the shallow clone worth the hassle?

http://blogs.gnome.org/simos/2009/04/18/git-clones-vs-shallow-git-clones/

For a repo that is relatively sane now (but had a psychotic episode a few years back when someone checked in a big file) the savings will be better - the shallow clone will mean you probably don't have to download that massive blob - but if the repo is under your control, it's probably just better to clean the repo history up using git-filter-branch or similar, so that everyone gets the benefit of a saner history.

best regards,
Roberto



On 11 January 2013 08:41, Justin Saliba <salijust@xxxxxxxxxxx> wrote:
Hi,

I was wondering whether it would be possible to execute a shallow clone using your library? A stackoverflow question (http://stackoverflow.com/questions/11475263/shallow-clone-with-jgit) from a few months back suggests that you can't but I was hoping that the functionality would be implemented by now.

Thanks.

Back to the top