From: Olof Johansson <olof.johansson@axis.com>
To: Mark Hatle <mark.hatle@windriver.com>
Cc: bitbake-devel@lists.openembedded.org
Subject: Re: [PATCH 2/3] gitsm.py: Add support for alternative URL formats from submodule files
Date: Wed, 9 Jan 2019 02:18:27 +0100 [thread overview]
Message-ID: <20190109011827.4crsftenh2c5pfst@axis.com> (raw)
In-Reply-To: <20190108233847.81353-3-mark.hatle@windriver.com>
On 19-01-08 18:38 -0500, Mark Hatle wrote:
> Note, in SSH format we simply replace the ':' with a '/' when constructing
> the URL. However, if the original path was ":/...", we don't want '//' so
> we deal with this corner case as well.
...
> + if ":/" in uris[module]:
> + url = "gitsm://" + uris[module].replace(':/', '/', 1)
> + else:
> + url = "gitsm://" + uris[module].replace(':', '/', 1)
Without a / prefix in the original ssh path, the path becomes
relative to whatever the ssh server wants, usually the user's
$HOME. I.e., they do not refer to the same path on the remote
system.
alice@example.com:/foo.git -> ssh://alice@example.com/foo.git
alice@example.com:foo.git -> ssh://alice@example.com/home/alice/foo.git (or something else!)
The path in an ssh:// uri is absolute, so the relative case must
be handled differently. But it's easy, git supports ~ expansion,
like:
alice@example.com:foo.git -> ssh://alice@example.com/~/foo.git
--
olofjn
next prev parent reply other threads:[~2019-01-09 1:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-08 23:38 [PATCH 0/3] gitsm.py: submodule init and ssh url processing Mark Hatle
2019-01-08 23:38 ` [PATCH 1/3] gitsm.py: Fix when a submodule is defined, but not initialized Mark Hatle
2019-01-08 23:38 ` [PATCH 2/3] gitsm.py: Add support for alternative URL formats from submodule files Mark Hatle
2019-01-09 1:18 ` Olof Johansson [this message]
2019-01-09 1:29 ` Olof Johansson
2019-01-09 16:33 ` Mark Hatle
2019-01-08 23:38 ` [PATCH 3/3] tests/fetch.py: Add alternative gitsm test case Mark Hatle
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=20190109011827.4crsftenh2c5pfst@axis.com \
--to=olof.johansson@axis.com \
--cc=bitbake-devel@lists.openembedded.org \
--cc=mark.hatle@windriver.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