git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: recursive cloning with --reference-if-able + --dissociate
Date: Thu, 13 Feb 2020 08:18:38 -0800	[thread overview]
Message-ID: <xmqqv9oasboh.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <83602548-c0a6-db37-ccdf-5c0f4b233b2e@rasmusvillemoes.dk> (Rasmus Villemoes's message of "Thu, 13 Feb 2020 15:45:14 +0100")

Rasmus Villemoes <rv@rasmusvillemoes.dk> writes:

> At $dayjob, most of our projects are organized as a rather small
> superproject, with a number of git submodules. Usually, one of those
> submodules is a linux kernel git tree.
>
> For CI testing, we create a fresh docker container which starts by doing
> a "git clone --recursive $superproject", which takes quite a while due
> to the linux repo. So we'd like to speed that up by having a reasonable
> up-to-date linux repo on each build slave, mapping that into the docker
> container, and then telling git "when you get to cloning the src/linux
> submodule, look over here for objects", i.e. having some way to have
> --reference-if-able and --disassociate in effect for submodules.
>
> If this is already possible, I can't find it in the documentation. And
> if it doesn't exist, I can't really think of a good way to define the UI
> for giving those options (other than, perhaps, having a top-level
> --reference-if-able pass down to the submodules with the meaning 'when
> initializing the submodule at some/path, try to use the submodule, if
> any, at some/path in the referenced top-level repo'".

Sorry for not giving a full solution but I suspect that discussing
this topic will lead to a useful new feature, similar in spirit to
the url rewriting (i.e. "url.$LOCAL.insteadOf = $REMOTE") to tell
Git to use a local mirror $LOCAL instead of the remote authentic
repository when interacting with $REMOTE.

Perhaps "url.$LOCALREF.autoReference = $REMOTE" to specify a local
mirror that does not have to be completely up-to-date, that will
altomatically be used as if "--reference-if-able $LOCALREF" is
passed when running "git clone $REMOTE", or something like that.

The actual design has to get a lot more involved, including
deciding:

 - if autoReference is orthogonal to --disssociate (I think it
   should be but others may differ).

 - how the way --dissociate is passed down from the top-level
   superproject to cloning of submodules is controlled (passing
   unconditionally would probably be too coarse, but I dunno).

etc. etc.

      reply	other threads:[~2020-02-13 16:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-13 14:45 recursive cloning with --reference-if-able + --dissociate Rasmus Villemoes
2020-02-13 16:18 ` Junio C Hamano [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqv9oasboh.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=rv@rasmusvillemoes.dk \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).