Re: [RFC] shallow clone
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:17
This is whacky, but another completely different strategy is to
introduce remote alternates.
If you can allow objects/info/alternates to name a repository
that is not on the local disk, we can set the original remote
repository we "clone" from as one of the alternates, and teach
read_sha1_file() to locally cache objects we read from remote
alternates.
After such a "shallow clone", the user may want to prime the
cache by something like:
$ git-rev-list --objects v2.6.14..master |
git-pack-objects --stdout >/dev/null
before going offline. Obviously you can keep the resulting pack
instead of leaving things loose.
I am not seriously advocating this yet -- adding calls to http
and git transfer machinery in read_sha1_file(), which is as low
level as you can go, is not something I have guts to do at the
moment.