From: Junio C Hamano <gitster@pobox.com>
To: Mark Levedahl <mlevedahl@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-submodule.sh - Remove trailing / from URL if found
Date: Wed, 20 Aug 2008 20:26:41 -0700 [thread overview]
Message-ID: <7vfxozkpzi.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <1219280847-872-1-git-send-email-mlevedahl@gmail.com> (Mark Levedahl's message of "Wed, 20 Aug 2008 21:07:27 -0400")
Mark Levedahl <mlevedahl@gmail.com> writes:
> git clone does not complain if a trailing '/' is included in the origin
> URL, but doing so causes resolution of a submodule's URL relative to the
> superproject to fail. Trailing /'s are likely when cloning locally using
> tab-completion, so the slash may appear in either superproject or
> submodule URL. So, ignore the trailing slash if it already exists in
> the superproject's URL, and don't record one for the submodule (which
> could itself have submodules...).
>
> Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
> ---
> git-submodule.sh | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
Hmm. I was sort of hoping to hear "Junio you idiot you do not know what
you are talking about --- your example of using ".." as relative won't
happen because of such and such reasons; trust me I know what is going on
in the vicinity of this code."
And after looking at the callsites of the shell function, I think the
original can never pass ".." (there are case statements to pass only $url
that match "./*" or "../*"), so I think both your original and this
version are safe as long as the part that match the trailing "/*" is
sane.
So I'll queue your first patch, as it is slightly shorter ;-)
Thanks.
next prev parent reply other threads:[~2008-08-21 3:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-20 2:18 [PATCH] git-submodule.sh - Remove trailing / from URL if found Mark Levedahl
2008-08-20 4:07 ` Junio C Hamano
2008-08-21 1:07 ` Mark Levedahl
2008-08-21 3:26 ` Junio C Hamano [this message]
2008-08-21 12:04 ` Mark Levedahl
2008-08-21 18:00 ` Junio C Hamano
2008-08-21 23:54 ` Mark Levedahl
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=7vfxozkpzi.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=mlevedahl@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.
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).