From: Junio C Hamano <gitster@pobox.com>
To: "Mark Levedahl" <mlevedahl@gmail.com>
Cc: "Junio C Hamano" <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH] git-submodule.sh - Remove trailing / from URL if found
Date: Thu, 21 Aug 2008 11:00:47 -0700 [thread overview]
Message-ID: <7vej4ii6y8.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <30e4a070808210504l1dd6b491l1d66dcd96a238ebc@mail.gmail.com> (Mark Levedahl's message of "Thu, 21 Aug 2008 08:04:34 -0400")
"Mark Levedahl" <mlevedahl@gmail.com> writes:
> The problem I'm trying to fix is that a number of folks have
> superprojects checked out where the recorded origin URL has a trailing
> /, and a submodule has its origin in a directory sitting right next to
> the superproject on the server. Thus, we have:
>
> superproject url = server:/public/super
> submodoule url = server:/public/sub1
>
> However, in the checked out superproject's .git/config
> [remote "origin"]
> url = server:/public/super/
>
> and for similar reasons, the submodule has its URL recorded in .gitmodules as
> [submodule "sub"]
> path = submodule1
> url = ../sub1/
>
> resolve_relative_url gets the submodule's recorded url as $1, which
> the caller retrieved from .gitmodules, and retrieves the superprojects
> origin from .git/config. So in this case resolve_relative_url has
> that:
> url = ../sub1/
> remoteurl = server:/public/super/
>
> So, without any patch, resolve_relative_url computes the submodule's URL as:
> server:/public/super/sub1/
>
> with the first patch as:
> server:/public/super/sub1
>
> and with the second as
> server:/public/sub1
> rather than
> server:/public/sub1
>
> So, the second patch I sent is the one that fixes the above problem,
> and I have to say I now forget what the confused state of .gitmodules
> + .git/config I found on one machine that lead to the first patch as
> being a correct fix.
>
> In summary, it is essential that resolve_relative_url strip the
> trailing / from the superproject's url before starting, while it is
> nice but not necessary if it assures that the result does not contain
> a trailing /.
Well, that is a description worth having in the proposed commit log
message, isn't it?
next prev parent reply other threads:[~2008-08-21 18:02 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
2008-08-21 12:04 ` Mark Levedahl
2008-08-21 18:00 ` Junio C Hamano [this message]
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=7vej4ii6y8.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).