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

Re: [BUG?] fetch into shallow sends a large number of objects

From
Jeff King <peff@peff.net>
Date
Mar 11, 2016, 18:16 UTC
Message-ID
<20160311181635.GA31299@sigill.intra.peff.net>
In-Reply-To
<CACsJy8BRhuSOs96fonjBJ0ok6JZJ3CwLkDPCP_9QQdROZUVh8w@mail.gmail.com>
On Fri, Mar 11, 2016 at 07:47:34AM +0700, Duy Nguyen wrote:
Show 9 quoted lines
> Well, assume again that F and G are ref heads, and their respective
> distance to C and D are the same (like the below graph), then "fetch
> --deptch=<distance>" can mark C and D as shallow cut points because
> --depth traverses from refs until the distance is met, it does not do
> total exclusion ^C like rev-list.
> 
>        --- B ---- C ---- H ---- F
>           /      /
>      --- D ---- E ---- G

Right, so I think we would only apply the "use existing cutoffs as bounds" thing when we were not otherwise given a --depth. Because it can definitely cause us to override the depth (and there's no need to; the point is to avoid linking in all of history, and --depth already solves that). So we probably do want the client to ask "I'm not giving you a depth, but please use my existing shallows as cutoffs".

I think a more interesting case here is when we have C as a cutoff, and somebody fetches "E" directly. They are part of the truncated history. So we should exclude them from a fetch of "G", but if the user asked for them directly, that probably needs to override the existing shallow cutoff.

We probably want to compute the --boundary of "E ^C", but then omit from that any items that are directly in want_obj. IOW, it is OK to truncate at depth=1 due to an existing cutoff, but not at depth=0. :)

That does mean we would then fetch all of the history leading up to E, but I think that's OK. If the user didn't specify --depth and they are fetching from behind the shallow-cutoff point, we don't have any real way of knowing how much they wanted (though I guess it would also be sensible to just apply depth=1 in such a case).

-Peff
Previous: Junio C Hamano
Message 16 of 16 in “[BUG?] fetch into shallow sends a large number of objects”
  1. Jeff KingMar 7, 2016
  2. Junio C HamanoMar 7, 2016
  3. Duy NguyenMar 8, 2016
  4. Jeff KingMar 8, 2016
  5. Jeff KingMar 8, 2016
  6. Duy NguyenMar 8, 2016
  7. Jeff KingMar 8, 2016
  8. Jeff KingMar 8, 2016
  9. Duy NguyenMar 8, 2016
  10. Duy NguyenMar 10, 2016
  11. Jeff KingMar 10, 2016
  12. Junio C HamanoMar 10, 2016
  13. Jeff KingMar 10, 2016
  14. Duy NguyenMar 11, 2016
  15. Junio C HamanoMar 11, 2016
  16. Jeff KingMar 11, 2016

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.