git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Beller <sbeller@google.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>,
	Jens Lehmann <Jens.Lehmann@web.de>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCHv2 0/6] git clone: Marry --recursive and --reference
Date: Tue, 9 Aug 2016 15:05:07 -0700	[thread overview]
Message-ID: <CAGZ79kYkn6eVUBd_hXd4FSxr+y-iNTSsOfqdcKWBWp-aaVpAkQ@mail.gmail.com> (raw)
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`.

> *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.

>
>     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.

  reply	other threads:[~2016-08-09 22:05 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-09  4:08 [PATCHv2 0/6] git clone: Marry --recursive and --reference Stefan Beller
2016-08-09  4:08 ` [PATCHv3 1/9] t7408: modernize style Stefan Beller
2016-08-09  6:59   ` Eric Sunshine
2016-08-09 15:50     ` Junio C Hamano
2016-08-09 15:51       ` Junio C Hamano
2016-08-09 17:30         ` Stefan Beller
2016-08-09 17:39           ` Junio C Hamano
2016-08-09 23:06             ` Eric Sunshine
2016-08-09  4:08 ` [PATCHv3 2/9] t7408: merge short tests, factor out testing method Stefan Beller
2016-08-09 16:41   ` Junio C Hamano
2016-08-09 17:26     ` Stefan Beller
2016-08-09  4:08 ` [PATCHv3 3/9] submodule--helper module-clone: allow multiple references Stefan Beller
2016-08-09  4:08 ` [PATCHv3 4/9] submodule--helper update-clone: " Stefan Beller
2016-08-09  4:08 ` [PATCHv3 5/9] clone: clarify option_reference as required Stefan Beller
2016-08-09  4:08 ` [PATCHv2 5/6] submodule update: add super-reference flag Stefan Beller
2016-08-09  4:08 ` [PATCHv3 6/9] clone: implement optional references Stefan Beller
2016-08-09 16:37   ` Junio C Hamano
2016-08-09 17:54     ` Junio C Hamano
2016-08-09 18:20       ` Stefan Beller
2016-08-09 18:35         ` Junio C Hamano
2016-08-09  4:08 ` [PATCHv2 6/6] clone: reference flag is used for submodules as well Stefan Beller
2016-08-09  4:08 ` [PATCHv3 7/9] submodule helper: pass through --reference-if-able Stefan Beller
2016-08-09  4:08 ` [PATCHv3 8/9] submodule: try alternates when superproject has an alternate Stefan Beller
2016-08-09  4:08 ` [PATCHv3 9/9] submodule--helper: use parallel processor correctly Stefan Beller
2016-08-09 16:40   ` Junio C Hamano
2016-08-09  5:23 ` [PATCHv2 0/6] git clone: Marry --recursive and --reference Jacob Keller
2016-08-09 15:49 ` Junio C Hamano
2016-08-09 17:26   ` Stefan Beller
2016-08-09 17:47     ` Junio C Hamano
2016-08-09 17:58       ` Junio C Hamano
2016-08-09 18:09       ` Stefan Beller
2016-08-09 18:44         ` Junio C Hamano
2016-08-09 20:31           ` Stefan Beller
2016-08-09 21:45             ` Junio C Hamano
2016-08-09 22:05               ` Stefan Beller [this message]
2016-08-10 15:59                 ` Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2016-08-06  1:23 Stefan Beller
2016-08-06 17:29 ` Junio C Hamano
2016-08-08 18:16   ` Stefan Beller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGZ79kYkn6eVUBd_hXd4FSxr+y-iNTSsOfqdcKWBWp-aaVpAkQ@mail.gmail.com \
    --to=sbeller@google.com \
    --cc=Jens.Lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mst@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).