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

Re: [PATCH/RFC 0/3] --seed as an alias for --dissociate --reference

From
Junio C Hamano <gitster@pobox.com>
Date
May 21, 2015, 05:01 UTC
Message-ID
<xmqqmw0yle0y.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20150521041435.GA18978@peff.net>
Jeff King <peff@peff.net> writes:
> .... Having just read through it, I think a succinct name for the
> idea is "seed". That is, we seed the clone with objects from another
> repository.
That's a nice name.
Show 15 quoted lines
> That thread also brought up the idea that we do not necessarily need to
> seed from a local repository; we could do something like:
>
>   1. Fetch from the seed repo into refs/seed/*
>
>   2. Fetch from the real clone source; the fetch is optimized by the
>      presence of refs/seed/*.
>
>   3. Delete refs/seed/*. Optionally repack to drop any objects needed
>      only by the seed refs.
>
> This is awkward with the "--reference" interface, because its
> implementation is publicly tied to the concept of alternates. Whereas
> "--seed" is about the end result you want; we can implement it using
> alternates or with a clone, depending on where the repo is located.
Show 6 quoted lines
> There are a few open issues with this series:
>
>   1. Assuming that "seed" is a reasonable verb for this concept, is
>      "--seed=<repo>" OK for the option?  Would "--seed-from=<repo>" be
>      better? (Also, the response "bleh, seed is a terrible name" is
>      fine, too, but only if accompanied by your own suggestion :) ).

The seed may not even have to be a repository. A bundle file hosted on CDN that is reachable via (resumable) wget would be another good way to prime the well, and it would fit with the above framework nicely. Grab it, fetch from it into a temporary hierarchy and then run "fetch --prune" against the repository you originally wanted to clone from.

Show 20 quoted lines
>   2. My main goal here is making the concept easier to explain to users.
>      The documentation in the third patch explains "--seed" as an alias
>      for the other options, which probably isn't helping much. It might
>      make sense to have a patch 4/3 that explains "--seed" first, and
>      then explains "--reference" as "like --seed, but keep the
>      relationship after the clone". Or maybe they should just get their
>      own descriptions entirely.
>
>   3. We can't dissociate from a specific alternate, so using "--seed"
>      implies that all "--reference" options get dissociated. In this
>      series, I issue a warning in that case.  But that would be easily
>      solved if "--seed" used the fetch strategy described above, even
>      for local clones (which would probably still be quite fast if we
>      took clone's usual hard-link shortcut instead of actually fetching
>      from a local clone).
>
> I don't have particular plans to implement generic "--seed" from remotes
> anytime soon. I think this takes us a step in the right direction
> interface-wise, and it does introduce a succinct concept and
> option.
Yes.  I like the name, the concept and the general direction.
Previous: Jeff KingNext: Jeff King
Message 13 of 16 in “--seed as an alias for --dissociate --reference”
  1. 0/3 --seed as an alias for --dissociate --referenceJeff King, May 21, 2015
  2. 1/3 clone: use OPT_STRING_LIST for --referenceJeff King, May 21, 2015
  3. 2/3 clone: reorder --dissociate and --reference optionsJeff King, May 21, 2015
  4. 3/3 clone: add `--seed` shorthandJeff King, May 21, 2015
  5. Johannes SchindelinMay 21, 2015
  6. Philip OakleyMay 21, 2015
  7. Johannes SchindelinMay 22, 2015
  8. Jeff KingMay 22, 2015
  9. Junio C HamanoMay 24, 2015
  10. Jeff KingMay 27, 2015
  11. Junio C HamanoMay 27, 2015
  12. Jeff KingMay 22, 2015
  13. Junio C HamanoMay 21, 2015
  14. Jeff KingMay 21, 2015
  15. Junio C HamanoMay 21, 2015
  16. Michael HaggertyMay 24, 2015

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.