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

Re: Bug with URL-decoding

From
Jeff King <peff@peff.net>
Date
May 23, 2010, 09:16 UTC
Message-ID
<20100523091612.GB26123@coredump.intra.peff.net>
In-Reply-To
<loom.20100507T000406-241@post.gmane.org>
On Thu, May 06, 2010 at 10:06:50PM +0000, Dave Abrahams wrote:
Show 9 quoted lines
> $ cd /tmp
> $ mkdir x+y
> $ cd x+y
> $ git init
> $ cd ..
> $ git clone file:///tmp/x%2By zz  # <==== ERROR
> $ git clone file:///tmp/x+y zz # <====== OK
> 
> Funny characters do come up in names, especially in test suites

Yeah, at this point file:// is more or less just an alias for a straight path (and ssh:// an alias for "host:path" syntax). We correctly percent-decode http:// URLs because we just hand them to curl, which does the right thing. We should be decoding these ones when we pick apart the URL components.

Patch series to follow:
  [1/2]: make url-related functions reusable
  [2/2]: decode file:// and ssh:// URLs
With these patches, you can do:
  git clone file:///tmp/x%2By
or
  git clone /tmp/x+y

The former will clone into "x%2By". Which I'm not even sure is wrong, so I left it as-is.

-Peff
Previous: Dave AbrahamsNext: Jeff King
Message 2 of 6 in “Bug with URL-decoding”
  1. Dave AbrahamsMay 6, 2010
  2. Jeff KingMay 23, 2010
  3. 1/2 make url-related functions reusableJeff King, May 23, 2010
  4. 2/2 decode file:// and ssh:// URLsJeff King, May 23, 2010
  5. Ilari LiusvaaraMay 27, 2010
  6. Jeff KingMay 30, 2010

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.