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

Re: [PATCHv2 0/6] git clone: Marry --recursive and --reference

From
Stefan Beller <sbeller@google.com>
Date
Aug 9, 2016, 22:05 UTC
Message-ID
<CAGZ79kYkn6eVUBd_hXd4FSxr+y-iNTSsOfqdcKWBWp-aaVpAkQ@mail.gmail.com>
In-Reply-To
<xmqqeg5x8vl4.fsf@gitster.mtv.corp.google.com>
On Tue, Aug 9, 2016 at 2:45 PM, Junio C Hamano <gitster@pobox.com> wrote:
> becomes easily doable (i.e. subsequent "submodule update" can realize
> that the submodule does not have alternates but it could borrow from
> the submodule in the other-super-project-location).
I would suggest to postpone this to a later time once the need arises.

I rather imagine that once you clone from "other-super-project-location" and get the warning about no alternates borrowing, you can decide if you want to set it up and link the submodule manually to that alternate, or if you just don't care about this one repository being duplicated.

For now I plan to introduce 2 options, as these are 2 different things, that can be extended independently of each other:

submodule.alternateLocation::
    Specifies how the submodules obtain alternates when submodules are
    cloned. Possible values are `no`, `superproject`.
    By default `no` is assumed, which doesn't add references. When the
    value is set to `superproject` the submodule to be cloned computes
    its alternates location relative to the superprojects alternate.
submodule.alternateErrorStrategy::
    Specifies how to treat errors with the alternates for a submodule
    as computed via `submodule.alternateLocation`. Possible values are
    `ignore`, `info`, `die`.
Show 7 quoted lines
> *1* Rather, I meant: clone has a very intimate knowledge on what and
>     what cannot be borrowed from and it is not just "is there a
>     directory?", so "git submodule update --init" is not in a good
>     position to decide if it wants to add --reference to the
>     invocation of "git clone" it makes internally, and introducing
>     an "if-able" variant to "clone" is one way to relieve it from
>     having to make that decision.
That is how I first understood the design as well.
Show 7 quoted lines
>
>     I could have suggested an alternative: because the submodule
>     machinery is gettting moved to C the "update --init" code that
>     drives the internal invocation of "git clone" could share the
>     the logic in "git clone --reference" that determines if a local
>     repository can be used as an alternate by small refactoring of
>     builtin/clone.c::add_one_reference().

I see. I might actually need to do this anyway as the helper is a place to act on the submodule.alternateErrorStrategy.

Previous: Junio C HamanoNext: Junio C Hamano
Message 35 of 36 in “[PATCHv2 0/6] git clone: Marry --recursive and --reference”
  1. Stefan BellerAug 9, 2016
  2. 3/9 submodule--helper module-clone: allow multiple referencesStefan Beller, Aug 9, 2016
  3. 1/9 t7408: modernize styleStefan Beller, Aug 9, 2016
  4. Eric SunshineAug 9, 2016
  5. Junio C HamanoAug 9, 2016
  6. Junio C HamanoAug 9, 2016
  7. Stefan BellerAug 9, 2016
  8. Junio C HamanoAug 9, 2016
  9. Eric SunshineAug 9, 2016
  10. 2/9 t7408: merge short tests, factor out testing methodStefan Beller, Aug 9, 2016
  11. Junio C HamanoAug 9, 2016
  12. Stefan BellerAug 9, 2016
  13. 4/9 submodule--helper update-clone: allow multiple referencesStefan Beller, Aug 9, 2016
  14. 5/9 clone: clarify option_reference as requiredStefan Beller, Aug 9, 2016
  15. 5/6 submodule update: add super-reference flagStefan Beller, Aug 9, 2016
  16. 6/6 clone: reference flag is used for submodules as wellStefan Beller, Aug 9, 2016
  17. 9/9 submodule--helper: use parallel processor correctly.Stefan Beller, Aug 9, 2016
  18. Junio C HamanoAug 9, 2016
  19. 8/9 submodule: try alternates when superproject has an alternateStefan Beller, Aug 9, 2016
  20. 7/9 submodule helper: pass through --reference-if-ableStefan Beller, Aug 9, 2016
  21. 6/9 clone: implement optional referencesStefan Beller, Aug 9, 2016
  22. Junio C HamanoAug 9, 2016
  23. Junio C HamanoAug 9, 2016
  24. Stefan BellerAug 9, 2016
  25. Junio C HamanoAug 9, 2016
  26. Jacob KellerAug 9, 2016
  27. Junio C HamanoAug 9, 2016
  28. Stefan BellerAug 9, 2016
  29. Junio C HamanoAug 9, 2016
  30. Junio C HamanoAug 9, 2016
  31. Stefan BellerAug 9, 2016
  32. Junio C HamanoAug 9, 2016
  33. Stefan BellerAug 9, 2016
  34. Junio C HamanoAug 9, 2016
  35. Stefan BellerAug 9, 2016
  36. Junio C HamanoAug 10, 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.