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

Re: git-svn SVN 1.7 fix, take 2

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 25, 2012, 07:14 UTC
Message-ID
<7v1uk0e2hy.fsf@alter.siamese.dyndns.org>
In-Reply-To
<500F85F7.8050304@pobox.com>
Michael G Schwern <schwern@pobox.com> writes:
Show 16 quoted lines
> On 2012.7.24 9:53 PM, Jonathan Nieder wrote:
>> Michael G Schwern wrote:
>> 
>>> No, now it's just canonicalizing as early as possible.  Preferably within the
>>> object accessor rather than at the point of use.  So in the code below,
>>> $full_url is already escaped/canonicalized.
>> 
>> Let's start with this.
>> 
>> Is svn_path_canonicalize() idempotent?  What does it do when it
>> encounters a percent-sign?
>
> Nothing, because paths are not URI escaped. :)
>
> You probably meant svn_uri_canonicalize().  And no, it does not double escape,
> so its safe to escape as early as possible.

Are you saying that the function assumes that a local pathname would not have '%' in it, returns its input as-is when it sees one, and if the caller really needs to express a path with '%' in it, it is the responsibility of the caller to escape it?

That makes it even more confusing....
Show 7 quoted lines
>    my $uri = "http://www.example.com/ foo";
>
>     print SVN::_Core::svn_uri_canonicalize(
>         SVN::_Core::svn_uri_canonicalize($uri)
>     );
>
> That produces "http://www.example.com/%20foo".

In other words, if your DocumentRoot was /var/www and you have a directory /var/www/per%cent you want to expose to the outside world, you have to say "http://www.example.com/per%25cent" yourself and the "canonicalize" function will be an identity function?

I have this vague suspicion that Jonathan was asking about what your Git::SVN::Utils::canonicalize_path() sub does, so all of the above might be moot, though...

Previous: Michael G SchwernNext: Michael G Schwern
Message 13 of 14 in “git-svn SVN 1.7 fix, take 2”
  1. Michael G SchwernJul 24, 2012
  2. Junio C HamanoJul 24, 2012
  3. Michael G SchwernJul 24, 2012
  4. Jonathan NiederJul 24, 2012
  5. Jonathan NiederJul 24, 2012
  6. Michael G SchwernJul 24, 2012
  7. Jonathan NiederJul 24, 2012
  8. Jonathan NiederJul 24, 2012
  9. Junio C HamanoJul 24, 2012
  10. Michael G SchwernJul 25, 2012
  11. Jonathan NiederJul 25, 2012
  12. Michael G SchwernJul 25, 2012
  13. Junio C HamanoJul 25, 2012
  14. Michael G SchwernJul 25, 2012

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.