From: Johannes Sixt <j6t@kdbg.org>
To: Stefan Beller <sbeller@google.com>
Cc: Junio C Hamano <gitster@pobox.com>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
"git@vger.kernel.org" <git@vger.kernel.org>,
"Karl A." <venv21@gmail.com>,
Dennis Kaarsemaker <dennis@kaarsemaker.net>,
Jonathan Nieder <jrnieder@gmail.com>
Subject: Re: [PATCH 2/3] submodule tests: replace cloning from . by "$(pwd)"
Date: Sun, 23 Oct 2016 12:14:26 +0200 [thread overview]
Message-ID: <61637cd9-8f83-c988-15c0-54f948153c07@kdbg.org> (raw)
In-Reply-To: <CAGZ79kaukGh2ynkOQcF=skzxTMYr8CFRyGJw6FEmNsTAcaG_VQ@mail.gmail.com>
Am 22.10.2016 um 22:46 schrieb Stefan Beller:
> I have looked into it again, and by now I think the bug is a feature,
> actually.
>
> Consider this:
>
> git clone . super
> git -C super submodule add ../submodule
> # we thought the previous line is buggy
> git clone super super-clone
At this point, we *should* have this if there were no bugs (at least
that is my assumption):
/tmp
!
+ submodule <- submodule's remote repo
!
+ foo <- we are here (.), super's remote repo
!
+ super <- remote.origin.url=/tmp/foo/.
!
+ submodule <- remote.origin.url=/tmp/foo/./../submodule
submodule.submodule.url=../submodule
When I test this, 'git submodule add' fails:
foo@master> git -C super submodule add ../submodule
fatal: repository '/tmp/foo/submodule' does not exist
fatal: clone of '/tmp/foo/submodule' into submodule path
'/tmp/foo/super/submodule' failed
> Now in the super-clone the ../submodule is the correct
> relative url, because the url where we cloned from doesn't
> end in /.
I do not understand why this would be relevant. The question is not how
the submodule's remote URL ends, but how the submodule's remote URL is
constructed from the super-project's URL and the relative path specified
for 'git submodule add'.
Whether ../submodule or ./submodule is the correct relative URL depends
on where the origin of the submodule is located relative to the origin
of the super-project. In the above example, it is ../submodule. However,
the error message tells us that git looked in /tmp/foo/submodule, which
looks like the /. bug!
I do not understand where you see a feature here. What am I missing?
-- Hannes
next prev parent reply other threads:[~2016-10-23 10:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-21 23:59 [PATCH 0/3] Fix submodule url issues Stefan Beller
2016-10-21 23:59 ` [PATCH 1/3] t7506: fix diff order arguments in test_cmp Stefan Beller
2016-10-21 23:59 ` [PATCH 2/3] submodule tests: replace cloning from . by "$(pwd)" Stefan Beller
2016-10-22 7:09 ` Johannes Sixt
2016-10-22 7:33 ` Junio C Hamano
2016-10-22 20:46 ` Stefan Beller
2016-10-23 10:14 ` Johannes Sixt [this message]
2016-10-24 17:46 ` Junio C Hamano
2016-10-24 19:10 ` Stefan Beller
2016-10-24 19:47 ` Johannes Sixt
2016-10-21 23:59 ` [PATCH 3/3] submodule--helper: normalize funny urls 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
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=61637cd9-8f83-c988-15c0-54f948153c07@kdbg.org \
--to=j6t@kdbg.org \
--cc=Johannes.Schindelin@gmx.de \
--cc=dennis@kaarsemaker.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jrnieder@gmail.com \
--cc=sbeller@google.com \
--cc=venv21@gmail.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.
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).