From: Thomas Rast Date: Mon, 10 Jan 2011 17:05:12 GMT Subject: Re: [PATCH] submodule: fix relative url parsing for scp-style origin Message-ID: <201101101805.13251.trast@student.ethz.ch> In-Reply-To: <20110110164801.GA7714@burratino> Jonathan Nieder wrote: > Thomas Rast wrote: > > + case "$remoteurl" in > > + */*) > > + remoteurl="${remoteurl%/*}" > > + ;; > > + *:*) > > + remoteurl="${remoteurl%:*}" > > + sep=: > > + ;; > > What happens to > > url = ssh://example.com:1234 > url = ftp://ftp.example.com Neither specifies a repo, unless you count "the default dir on the remote side" (do we support that?). The existing code would have snipped at the / and constructed something like ssh:/otherrepo. > url = /local/path/with/a/colon:in:it > url = git://example.com/path/with/a/colon:in:it These work fine because the first case arm is "do we still have a slash?", and thus takes precedence over the colon splitting. > url = simple.subdir.of.cwd That's caught by the outer 'case': case "$url" in ../*) url="${url#../}" # ... what we're discussing here ;; ./*) url="${url#./}" ;; *) break;; -- Thomas Rast trast@{inf,student}.ethz.ch