git@vger.kernel.org mailing list mirror (one of many)
 help / color / Atom feed
From: Stefan Beller <sbeller@google.com>
To: Yaroslav Halchenko <yoh@onerussian.com>
Cc: git <git@vger.kernel.org>
Subject: Re: [wishlist] support of cloning recursively from non-bare submodule hierarchies?
Date: Thu, 13 Dec 2018 13:59:18 -0800
Message-ID: <CAGZ79kYMULBBDBt6Sx___m37TNkruYmpKto5ZGG7u7X1jHuKig@mail.gmail.com> (raw)
In-Reply-To: <20181213171917.GC4633@hopa.kiewit.dartmouth.edu>

On Thu, Dec 13, 2018 at 9:19 AM Yaroslav Halchenko <yoh@onerussian.com> wrote:
>
> Example - on http://datasets.datalad.org we have a few hundred datasets
> organized into a hierarchy as git submodules.  Each  git submodules carries its
> own .git/ directory so they are "self sufficient" and we could readily assess
> their sizes, and "cut the tree" at any level without looking for the
> supermodule somewhere high up in the tree.
>
> .gitmodules typically has relative paths for the url and path for the
> submodules there, the form which I think we chose because it used to work (I
> could be utterly wrong! but I think it was done in an informed fashion)
> for git clone --recursive:
>
>         $> curl http://datasets.datalad.org/labs/gobbini/famface/.gitmodules
>         [submodule "data"]
>                 path = data
>                 url = ./data
>
> and possibly outside:
>
>         $> curl http://datasets.datalad.org/labs/gobbini/famface/data/.gitmodules
>         [submodule "scripts/mridefacer"]
>                 path = scripts/mridefacer
>                 url = https://github.com/yarikoptic/mridefacer

So far so good.

> But unfortunately git doesn't even consider such (valid AFAIK) situation
> while cloning where url has to have .git suffix but repository is not bare and
> a relative "data" path (or "./data" url) is referring to the worktree.
>
>         $> git clone --recursive http://datasets.datalad.org/labs/gobbini/famface/.git
[..]
>         Submodule 'data' (http://datasets.datalad.org/labs/gobbini/famface/.git/data) registered for path 'data'

and here it goes wrong, and you would have expected to see
.../gobbini/famface/data, eliding the .git ?

I just checked and this did not work neither in v2.18.0 nor v2.0.0 of
Git, so it is
either a real old regression in submodules, or something else.
Is it possible that the clone worked once without the additional .git
in the superproject URL?

> on the server I use the "smart HTTP" git backend, but not sure if that is the one to blame, since
> I do not see in the logs any attempt to get the /data from not under .git/:

If we want to strip off "/.git" of urls to make submodules work,
we'd want to look at builtin/submodule--helper.c::compute_submodule_clone_url
that was recently introduced.

I wonder if we'd just want to cut off the "/.git" and assume the submodule
is there in the worktree. Or if we need to see if the submodule was
absorbed into .git/modules/<name> on the remote side. (But if the
submodule is checked out both would work)

      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-13 17:19 Yaroslav Halchenko
2018-12-13 21:59 ` Stefan Beller [this message]

Reply instructions:

You may reply publically 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=CAGZ79kYMULBBDBt6Sx___m37TNkruYmpKto5ZGG7u7X1jHuKig@mail.gmail.com \
    --to=sbeller@google.com \
    --cc=git@vger.kernel.org \
    --cc=yoh@onerussian.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

git@vger.kernel.org mailing list mirror (one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox