From: Junio C Hamano <gitster@pobox.com>
To: Eric Wong <normalperson@yhbt.net>
Cc: "Björn Steinbrink" <B.Steinbrink@gmx.de>,
git@vger.kernel.org, jsogo@debian.org
Subject: Re: [PATCH] git-svn: don't escape tilde ('~') for http(s) URLs
Date: Tue, 21 Oct 2008 14:53:28 -0700 [thread overview]
Message-ID: <7vtzb5wr6v.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20081021211131.GA21606@yp-box.dyndns.org> (Eric Wong's message of "Tue, 21 Oct 2008 14:12:15 -0700")
Eric Wong <normalperson@yhbt.net> writes:
>> strace revealed that git-svn url-encodes ~ while svn does not do that.
>>
>> For svn we have:
>> write(5, "<S:update-report send-all=\"true\" xmlns:S=\"svn:\">
>> <S:src-path>https://sucs.org/~welshbyte/svn/backuptool/trunk</S:src-path>...
>>
>> While git-svn shows:
>> write(7, "<S:update-report send-all=\"true\" xmlns:S=\"svn:\">
>> <S:src-path>https://sucs.org/%7Ewelshbyte/svn/backuptool/trunk</S:src-path>...
This looks like an XML based request sequence to me (and svn is talking
WebDAV here, right?); it makes me wonder what exact quoting rules are used
there. I would expect $path in <S:src-path>$path</S:src-path> to quote
a letters in it e.g. '<' as "<" --- which is quite different from what
the s/// substitutions in the patch seem to be doing.
> diff --git a/git-svn.perl b/git-svn.perl
> index ef6d773..a97049a 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -852,7 +852,7 @@ sub escape_uri_only {
> - s/([^\w.%+-]|%(?![a-fA-F0-9]{2}))/sprintf("%%%02X",ord($1))/eg;
> + s/([^~\w.%+-]|%(?![a-fA-F0-9]{2}))/sprintf("%%%02X",ord($1))/eg;
Admittedly I do not know git-svn (nor Perl svn bindings it uses), and I
suspect that some of the XML-level escaping is done in the libsvn side,
but it would be nice if somebody can at least verify that the code after
the patch works with repositories with funny characters in pathnames
(perhaps list all the printables including "<&>?*!@.+-%^"). Even nicer
would be a log message that says "the resulting code covers all cases
because it follows _that_ spec to escape _all_ problematic letters",
pointing at some in svn (or libsvn-perl) resource.
The patch may make a path with '~' work, but it (neither in the patch text
nor in the commit log message) does not have much to give readers enough
confidence that the code after the patch is the _final_ one, as opposed to
being just a band-aid for a single symptom that happened to have been
discovered this time.
next prev parent reply other threads:[~2008-10-21 21:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-18 21:39 git-svn url-encodes ~ when it should not Björn Steinbrink
2008-10-18 22:47 ` Björn Steinbrink
2008-10-21 21:12 ` [PATCH] git-svn: don't escape tilde ('~') for http(s) URLs Eric Wong
2008-10-21 21:53 ` Junio C Hamano [this message]
2008-10-22 6:13 ` Mike Hommey
2008-10-22 6:24 ` Junio C Hamano
2008-10-22 8:16 ` Eric Wong
2008-10-22 18:53 ` Junio C Hamano
2008-10-24 9:13 ` Eric Wong
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=7vtzb5wr6v.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=B.Steinbrink@gmx.de \
--cc=git@vger.kernel.org \
--cc=jsogo@debian.org \
--cc=normalperson@yhbt.net \
/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;
as well as URLs for NNTP newsgroup(s).