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

Re: Resumable clone

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 8, 2016, 17:25 UTC
Message-ID
<xmqqy49slw54.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CACsJy8A_jkvdJPgBQ_huP-t8a0ra2RfP7jZ7C-ONNm87ktYaiA@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 5 quoted lines
> Yeah the determination is tricky, it depends on server setup. Let's
> start with select the pack for download first because there could be
> many of them. A heuristic (*) of choosing the biggest one in
> $GIT_DIR/objects/pack is probably ok for now (we don't need full
> history, "the biggest part of history" is good enough).

You need to choose a pack that is fully connected, though. I was envisioning that an updated "git repack" would have an extra option that help server operators to manage it easily. You would need to consider for example:

 - You may not want to rebuild such a base pack too frequently
   (e.g. you may want to repack a busy repository twice a day, but
   you would want to redo the base pack only once a week).  It is
   possible to mark it with .keep for subsequent repacks to leave it
   alone, but there needs a mechanism to manage that .keep marker.
 - You may not want to have all refs in such a base pack (e.g. you
   may want to exclude refs/changes/ from it).  There need to be a
   configuration to specify which refs are included in the base
   pack.

while designing such an update. Then the repack with such an option would roughly be:

    - If it is time to redo a base repack, then
      - unplug the .keep bit the previous base pack has;
      - create a pack that contains full history reachable from the
        specified refs;
      - mark the new base pack as such;
    - Pack all objects that are not in the base pack that are
      reachable from any refs (and other anchoring points, such as
      reflogs and the index) into a separate pack.

And the prime_clone() advertisement would be just the matter of knowing how the "base" pack is marked in the above process.

Previous: Duy NguyenNext: Junio C Hamano
Message 12 of 14 in “Resumable clone”
  1. Kevin WernMar 5, 2016
  2. Duy NguyenMar 5, 2016
  3. Junio C HamanoMar 5, 2016
  4. Junio C HamanoMar 5, 2016
  5. Johannes SchindelinMar 6, 2016
  6. Duy NguyenMar 6, 2016
  7. Duy NguyenMar 6, 2016
  8. Junio C HamanoMar 6, 2016
  9. Junio C HamanoMar 7, 2016
  10. Kevin WernMar 8, 2016
  11. Duy NguyenMar 8, 2016
  12. Junio C HamanoMar 8, 2016
  13. Junio C HamanoMar 8, 2016
  14. Kevin WernMar 9, 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.