From: Mark Levedahl <mlevedahl@gmail.com>
To: Johan Herland <johan@herland.net>
Cc: git@vger.kernel.org
Subject: Re: Relative submodule URLs vs. clone URL DWIMming
Date: Thu, 28 Aug 2008 10:50:49 -0400 [thread overview]
Message-ID: <48B6BB49.3000703@gmail.com> (raw)
In-Reply-To: <200808271400.54302.johan@herland.net>
Johan Herland wrote:
>
> I'd like to fix this, but I'm not sure whether the fix belongs in
> builtin-clone.c (i.e. making sure the origin URL is always "correct"
> wrt. resolving relative submodule URLs), or in git-submodule.sh (i.e.
> adding smarts when resolving relative submodule URLs against the
> super-repo's origin URL).
>
>
> ...Johan
>
>
I think the right approach is to start with clone and make it record the
real url it is using, regardless of what was input. The problem with
doing this in submodule is that in effect this replicates the search
logic clone would use, and furthermore could lead to nasty surprises by
grabbing the wrong submodule in an extreme case of having two
identically named repositories in different locations on a server.
I was about to create a patch for submodule to always remove trailing
"/.git" before resolving, but in fact a user could put the submodule
.git into the superproject's .git, in a non-bare repository, and then
gitlink that in the checked out submodule. So, it may also be good to
define and enforce rules on how relative url naming can be used for this
purpose. So far, I have only used it for bare repositories using the
"../<path> form keeping the submodules out of the superproject.
Mark
next prev parent reply other threads:[~2008-08-28 14:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-27 12:00 Relative submodule URLs vs. clone URL DWIMming Johan Herland
2008-08-28 14:50 ` Mark Levedahl [this message]
2008-08-28 23:01 ` Johan Herland
2008-08-30 22:27 ` Junio C Hamano
2008-08-30 23:23 ` Johan Herland
2008-08-30 23:45 ` Junio C Hamano
2008-09-01 19:07 ` [PATCH] Bring local clone's origin URL in line with that of a remote clone Johan Herland
2008-09-02 7:23 ` Junio C Hamano
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=48B6BB49.3000703@gmail.com \
--to=mlevedahl@gmail.com \
--cc=git@vger.kernel.org \
--cc=johan@herland.net \
/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).