Re: [RFC PATCH] During a shallow fetch, prevent sending over unneeded objects
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Aug 9, 2013, 13:13 UTC
- Message-ID
- <CACsJy8A5VkyMcvtqu2J0COh5+pqKTkmCstLzDpPS5_0T+XFtsA@mail.gmail.com>
- In-Reply-To
- <7v1u64az18.fsf@alter.siamese.dyndns.org>
On Fri, Aug 9, 2013 at 12:10 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 16 quoted lines
> Duy Nguyen <pclouds@gmail.com> writes:
>
>> I fail to see the point here. There are two different things: what we
>> want to send, and what we can make deltas against. Shallow boundary
>> affects the former. What the recipient has affects latter. What is the
>> twist about?
>
> do_rev_list() --> mark_edges_uninteresting() --> show_edge() callchain
> that eventually does this:
>
> static void show_edge(struct commit *commit)
> {
> fprintf(pack_pipe, "-%s\n", sha1_to_hex(commit->object.sha1));
> }
>
> was what I had in mind.Now I see. Thanks.
mark_edges_uninteresting() actually calls mark_edge_parents_uninteresting(), which calls show_edge(). The middle function is important because after calculating new depth, upload-pack calls register_shallow() for all both old and new shallow roots and those commits will have their 'parents' pointer set to NULL, which renders mark_edge_parents_uninteresting() no-op. So show_edge() is never called on shallow points' parents.
Show 10 quoted lines
>> As for considering objects before shallow boundary uninteresting, I >> have a plan for it: kill upload-pack.c:do_rev_list(). The function is >> created to make a cut at shallow boundary,... > > Hmph, that function is not primarily about shallow boundary but does > all packing in general. > > The edge hinting in there is for thin transfer where the sender > sends deltas against base objects that are known to be present in > the receiving repository, without sending the base objects.
OK but edge hinting is the same in pack-objects.c:get_object_list() so the plan might still work, right? I still need to study about extra_edge_obj in upload-pack.c though. That's something knowledge that pack-objects won't have.
-- Duy