git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC PATCH] During a shallow fetch, prevent sending over unneeded objects

From
Duy Nguyen <pclouds@gmail.com>
Date
Aug 8, 2013, 07:21 UTC
Message-ID
<CACsJy8BahoGcDcLjSaHA-62_KQE2wD-p5oeJOOA4nk8ZRfXrEA@mail.gmail.com>
In-Reply-To
<7vfvukbrqh.fsf@alter.siamese.dyndns.org>
On Thu, Aug 8, 2013 at 1:51 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 10 quoted lines
> Duy Nguyen <pclouds@gmail.com> writes:
>
>> I think this applies to general case as well, not just shallow.
>> Imagine I have a disconnected commit that points to the latest tree
>> (i.e. it contains most of latest changes). Because it's disconnected,
>> it'll be ignored by the server side. But if the servide side does
>> mark_tree_interesting on this commit, a bunch of blobs might be
>> excluded from sending.
>
> I think you meant mark_tree_UNinteresting.
Yes, thanks for correcting.
Show 14 quoted lines
>> ... So perhaps we could go over have_obj list
>> again, if it's not processed and is
>>
>>  - a tree-ish, mark_tree_uninteresting
>>  - a blob, just mark unintesting
>>
>> and this does regardless of shallow state or edges.
>
> As a general idea, I agree it may be worth trying out to see if your
> concern that the "have" list may be so big that this approach may be
> more costly than it is worth.
>
> If the recipient is known to have something, we do not have to send
> it.
OK. Mathijs, do you want make a patch for it?
Show 13 quoted lines
> The things that we decide not to send are not necessarily what the
> recipient has, which introduces a twist you need to watch out for if
> we want to go that route.
>
> If the recipient is known to have something, a thin transfer can
> send a delta against it.  You do not want to send the commits before
> the shallow boundary (i.e. the parents of the commits listed in
> .git/shallow) because the recipient does not want them, and that
> means you may have to use a different mark to record that fact.  The
> recipient does not have them, we do not want to send them, and they
> cannot be used as a delta base for what we do send.  Which is quite
> different from the ordinary "uninteresting" objects, those we decide
> not to send because the recipient has them.

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?

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, but we already have a tool for that: grafting. In my ongoing shallow series I will create a temporary shallow file that contains new roots and pass the file to pack-objects with --shallow-file. pack-objects will never see anything outside what the recipient may want (i.e. commits before shallow boundary) to receive and pack-objects' rev-list should do what upload-pack.c:do_rev_list() currently does.

-- 
Duy
Previous: Junio C HamanoNext: Junio C Hamano
Message 10 of 30 in “During a shallow fetch, prevent sending over unneeded objects”
  1. During a shallow fetch, prevent sending over unneeded objectsMatthijs Kooijman, Jul 11, 2013
  2. Junio C HamanoJul 11, 2013
  3. Matthijs KooijmanJul 12, 2013
  4. Matthijs KooijmanAug 7, 2013
  5. Junio C HamanoAug 8, 2013
  6. Duy NguyenAug 8, 2013
  7. Junio C HamanoAug 8, 2013
  8. Duy NguyenAug 8, 2013
  9. Junio C HamanoAug 8, 2013
  10. Duy NguyenAug 8, 2013
  11. Junio C HamanoAug 8, 2013
  12. Duy NguyenAug 9, 2013
  13. Matthijs KooijmanAug 12, 2013
  14. Duy NguyenAug 16, 2013
  15. 1/6 Move setup_alternate_shallow and write_shallow_commits to shallow.cNguyễn Thái Ngọc Duy, Aug 16, 2013
  16. 2/6 shallow: only add shallow graft points to new shallow fileNguyễn Thái Ngọc Duy, Aug 16, 2013
  17. Eric SunshineAug 16, 2013
  18. 3/6 shallow: add setup_temporary_shallow()Nguyễn Thái Ngọc Duy, Aug 16, 2013
  19. Eric SunshineAug 16, 2013
  20. 4/6 upload-pack: delegate rev walking in shallow fetch to pack-objectsNguyễn Thái Ngọc Duy, Aug 16, 2013
  21. Matthijs KooijmanAug 28, 2013
  22. Duy NguyenAug 29, 2013
  23. 5/6 list-objects: reduce one argument in mark_edges_uninterestingNguyễn Thái Ngọc Duy, Aug 16, 2013
  24. 6/6 list-objects: mark more commits as edges in mark_edges_uninterestingNguyễn Thái Ngọc Duy, Aug 16, 2013
  25. Matthijs KooijmanAug 28, 2013
  26. Add testcase for needless objects during a shallow fetchMatthijs Kooijman, Aug 28, 2013
  27. Duy NguyenAug 29, 2013
  28. Duy NguyenAug 31, 2013
  29. Matthijs KooijmanOct 21, 2013
  30. Duy NguyenOct 26, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.