git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] submodule: fix relative url parsing for scp-style origin

From
Thomas Rast <trast@student.ethz.ch>
Date
Jan 10, 2011, 17:05 UTC
Message-ID
<201101101805.13251.trast@student.ethz.ch>
In-Reply-To
<20110110164801.GA7714@burratino>
Jonathan Nieder wrote:
Show 14 quoted lines
> 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
Previous: Jonathan NiederNext: Jonathan Nieder
Message 3 of 7 in “submodule: fix relative url parsing for scp-style origin”
  1. submodule: fix relative url parsing for scp-style originThomas Rast, Jan 10, 2011
  2. Jonathan NiederJan 10, 2011
  3. Thomas RastJan 10, 2011
  4. Jonathan NiederJan 10, 2011
  5. Thomas RastJan 10, 2011
  6. Junio C HamanoJan 10, 2011
  7. Mark LevedahlJan 11, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.