From: John Keeping <john@keeping.me.uk>
To: Jens Lehmann <Jens.Lehmann@web.de>
Cc: Heiko Voigt <hvoigt@hvoigt.net>,
Junio C Hamano <gitster@pobox.com>,
git@vger.kernel.org
Subject: Re: What's cooking in git.git (May 2013, #09; Wed, 29)
Date: Tue, 4 Jun 2013 23:04:18 +0100 [thread overview]
Message-ID: <20130604220418.GP1072@serenity.lan> (raw)
In-Reply-To: <51AE5E8D.7080007@web.de>
On Tue, Jun 04, 2013 at 11:39:25PM +0200, Jens Lehmann wrote:
> Am 04.06.2013 14:48, schrieb John Keeping:
> > The problem is that sometimes you do want to adjust the path and
> > sometimes you don't. Reading git-submodule(1), it says:
> >
> > This may be either an absolute URL, or (if it begins with ./ or
> > ../), the location relative to the superproject’s origin
> > repository.
> > [snip]
> > If the superproject doesn’t have an origin configured the
> > superproject is its own authoritative upstream and the current
> > working directory is used instead.
> >
> > So I think it's quite reasonable to have a server layout that looks like
> > this:
> >
> > project
> > |- libs
> > | |- libA
> > | `- libB
> > |- core.git
> >
> > and with only core.git on your local system do:
> >
> > cd core/libs
> > git submodule add ../libs/libB
> >
> > expecting that to point to libB. But if we adjust the path then the
> > user has to do:
> >
> > git submodule add ../../libs/libB
> >
> > However, it is also perfectly reasonable to have no remote configured
> > and the library next to the repository itself. In which case we do want
> > to specify the additional "../" so that shell completion works in the
> > natural way.
>
> Exactly.
>
> > The only way I can see to resolve the ambiguity is to die when we hit
> > this particular case.
>
> Hmm, I'm not so sure about that. Don't the first three lines in
> resolve_relative_url() show how to distinguish between these two
> cases?
>
> resolve_relative_url ()
> {
> remote=$(get_default_remote)
> remoteurl=$(git config "remote.$remote.url") ||
> remoteurl=$(pwd) # the repository is its own authoritative upstream
> ...
If it's this simple, yes. But I think there's also a third possibility
that combines both of these: what if the local directory structure is
the same as that on the "origin" remote? Then "origin" exists but we
still want to adjust for the subdirectory.
The risk is that I can't see a behaviour that doesn't seem to choose
whether to convert the given path or not arbitrarily. Even knowing the
rules, I expect that I could end up being surprised by this if I create
a new repository and haven't set up "origin" yet.
next prev parent reply other threads:[~2013-06-04 22:04 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-29 23:58 What's cooking in git.git (May 2013, #09; Wed, 29) Junio C Hamano
2013-05-30 9:47 ` Thomas Rast
2013-05-30 9:56 ` Ramkumar Ramachandra
2013-06-02 23:44 ` Junio C Hamano
2013-05-30 19:18 ` Jens Lehmann
2013-06-02 18:50 ` Junio C Hamano
2013-06-03 21:27 ` Jens Lehmann
2013-07-01 22:05 ` Junio C Hamano
2013-05-30 19:23 ` Jens Lehmann
2013-05-31 19:40 ` John Keeping
2013-06-03 14:54 ` John Keeping
2013-06-03 15:30 ` Junio C Hamano
2013-06-03 21:47 ` Jens Lehmann
2013-06-03 22:23 ` John Keeping
2013-06-04 5:29 ` Heiko Voigt
2013-06-04 8:10 ` John Keeping
2013-06-04 11:17 ` Heiko Voigt
2013-06-04 12:48 ` John Keeping
2013-06-04 21:39 ` Jens Lehmann
2013-06-04 22:04 ` John Keeping [this message]
2013-06-04 22:57 ` Re: " Phil Hord
2013-06-05 8:19 ` John Keeping
2013-05-31 6:16 ` Øystein Walle
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=20130604220418.GP1072@serenity.lan \
--to=john@keeping.me.uk \
--cc=Jens.Lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=hvoigt@hvoigt.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).