Subject: Re: Clone from shallow bundle bug

From: Phillip Susi <[email-masked]>
Date: Wed, 01 Apr 2015 09:00:56 -0400

On 4/1/2015 6:01 AM, Duy Nguyen wrote:
> On Wed, Apr 1, 2015 at 1:31 PM, Junio C Hamano <[email-masked]>
> wrote:
>> The only way a bundle can record "something" "noting" that it is
>> an incomplete history, while allowing it to be read by existing 
>> implementations of "git bundle unbundle" is to list the commits, 
>> behind which there is no history available in the bundle, as 
>> bundle's pre-requisites.  I said that the addition of shallow
>> repository support did not enhance "git bundle create" to do so,
>> and you are saying "it just needs to put", implying that it
>> currently does not.
> 
> Alternatively, we can record SHA-1 in the shallow file as refs
> whose name is always ".shallow". This way "unbundle" can recreate
> the shallow file if it wants. Having this "remote" shallow file
> would fit well in our fetch pipeline. It's harder to recreate
> shallow file if we record prerequisite instead: if commit A is in
> the shallow file, the ones in prerequisite category would be A's
> parents. So we would need to go over the bundle to look for commits
> whose parents are all in prerequisite list. It takes more time.

Right; you can't rely only on the pre-requisets as objects in the
bundle may be deltaed against them and so they can not be unpacked
without them.  The idea here is that all required objects ( and their
delta bases ) are present, either in the bundle, or in the local
repository, but if you walk the history chain you arrive at a parent
pointer to an object you don't have.  That point should automatically
be recorded in .git/shallow.