Junio C Hamano wrote:
I've been postponing thinking about shallow clones with a plan
to do so when I have absolutely nothing else to do for a solid
few days. Since my time is booked pretty much full with day job
and the ongoing pack-file topics these days, I will most likely
stick to that plan after I finish this message.
Not because I think it is an insignificant problem at the fringe
(I did not say "when I have nothing better to do"), but because
I feel this is something important (and hard) that requires
"think about it and only about it straight through for a few
days, dropping everything else" kind of thinking.
When you have a ref under .git/refs/ pointing at an object, you
are making this assertion:
The object store associated with this repository
(usually, .git/objects and alternates pointed at by
.git/objects/info/alternates) holds _all_ objects that
are recursively reachable from this object by following
tag reference, commit ancestry chain, commit to its
tree, and tree to its subtrees and blobs.
So by definition, a shallow clone is a broken/incomplete
repository. Unless we fix the breakage in some way.
One way to do so which has often been talked about is to use the
grafts facility. You cut off the history at some commit, and
cauterize the commit ancestry chain at that point by telling git
to pretend that the commit does not have any parent. While this
would work after setting it up, in the sense that "git log"
would stop at the commit and "git fsck-objects" would say
nothing is missing, it is cumbersome to set up, we do not have
an easy way to fetch (or clone -- but clone is a special case of
fetch where the downstream starts out from emptiness) from such
a repository, unplugging to get histories further back with
a later fetch is quite involved, and it is not clear what it
means to further fetch from such a shallow clone.
Pardon my ignorance, but won't having a http:// or ssh based url support in objects/info/alternates
will support such shallow clones. What i am wondering is can't we make the objects/info/alternates following code
traverse the network transport and make git log work like cvs log in case things are not in local repository. This
should make all the git operation slow, but if you are interested in speed one can clone the repository fully.
-aneesh
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html