From: Eric Wong <normalperson@yhbt•net>
To: Jonathan Nieder <jrnieder@gmail•com>
Cc: Michael G Schwern <schwern@pobox•com>,
git@vger•kernel.org, gitster@pobox•com, robbat2@gentoo•org,
bwalton@artsci•utoronto.ca
Subject: Re: [PATCH 2/2] git svn: canonicalize_url(): use svn_path_canonicalize when available
Date: Tue, 23 Oct 2012 22:58:12 +0000 [thread overview]
Message-ID: <20121023225812.GA21716@dcvr.yhbt.net> (raw)
In-Reply-To: <20121014114857.GB21106@elie.Belkin>
Jonathan Nieder <jrnieder@gmail•com> wrote:
> Until Subversion 1.7 (more precisely r873487), the standard way to
> canonicalize a URI was to call svn_path_canonicalize(). Use it.
>
> This saves "git svn" from having to rely on our imperfect
> reimplementation of the same. If the function doesn't exist or
> returns undef, though, it can use the fallback code, which we keep to
> be conservative. Since svn_path_canonicalize() was added before
> Subversion 1.1, hopefully that doesn't happen often.
Hi Jonathan, this fails for me using http (but not file:// or svn://).
1/2 of this RFC looks fine, though.
subversion 1.6.12dfsg-6, apache2-mpm-prefork 2.2.16-6+squeeze8
(Debian squeeze)
$ SVN_HTTPD_PORT=12345 sh t9118-git-svn-funky-branch-names.sh -v
Initialized empty Git repository in /home/ew/git-core/t/trash directory.t9118-git-svn-funky-branch-names/.git/
expecting success:
mkdir project project/trunk project/branches project/tags &&
echo foo > project/trunk/foo &&
svn_cmd import -m "$test_description" project "$svnrepo/pr ject" &&
rm -rf project &&
svn_cmd cp -m "fun" "$svnrepo/pr ject/trunk" \
"$svnrepo/pr ject/branches/fun plugin" &&
svn_cmd cp -m "more fun!" "$svnrepo/pr ject/branches/fun plugin" \
"$svnrepo/pr ject/branches/more fun plugin!" &&
svn_cmd cp -m "scary" "$svnrepo/pr ject/branches/fun plugin" \
"$svnrepo/pr ject/branches/$scary_uri" &&
svn_cmd cp -m "leading dot" "$svnrepo/pr ject/trunk" \
"$svnrepo/pr ject/branches/.leading_dot" &&
svn_cmd cp -m "trailing dot" "$svnrepo/pr ject/trunk" \
"$svnrepo/pr ject/branches/trailing_dot." &&
svn_cmd cp -m "trailing .lock" "$svnrepo/pr ject/trunk" \
"$svnrepo/pr ject/branches/trailing_dotlock.lock" &&
svn_cmd cp -m "reflog" "$svnrepo/pr ject/trunk" \
"$svnrepo/pr ject/branches/not-a@{0}reflog@" &&
start_httpd
Adding project/trunk
Adding project/trunk/foo
Adding project/branches
Adding project/tags
Committed revision 1.
Committed revision 2.
Committed revision 3.
Committed revision 4.
Committed revision 5.
Committed revision 6.
Committed revision 7.
Committed revision 8.
ok 1 - setup svnrepo
expecting success:
git svn clone -s "$svnrepo/pr ject" project &&
(
cd project &&
git rev-parse "refs/remotes/fun%20plugin" &&
git rev-parse "refs/remotes/more%20fun%20plugin!" &&
git rev-parse "refs/remotes/$scary_ref" &&
git rev-parse "refs/remotes/%2Eleading_dot" &&
git rev-parse "refs/remotes/trailing_dot%2E" &&
git rev-parse "refs/remotes/trailing_dotlock%2Elock" &&
git rev-parse "refs/remotes/$non_reflog"
)
Initialized empty Git repository in /home/ew/git-core/t/trash directory.t9118-git-svn-funky-branch-names/project/.git/
Bad URL passed to RA layer: URL 'http://127.0.0.1:12345/pr ject' is malformed or the scheme or host or path is missing at /home/ew/git-core/perl/blib/lib/Git/SVN.pm line 310
not ok - 2 test clone with funky branch names
#
# git svn clone -s "$svnrepo/pr ject" project &&
# (
# cd project &&
# git rev-parse "refs/remotes/fun%20plugin" &&
# git rev-parse "refs/remotes/more%20fun%20plugin!" &&
# git rev-parse "refs/remotes/$scary_ref" &&
# git rev-parse "refs/remotes/%2Eleading_dot" &&
# git rev-parse "refs/remotes/trailing_dot%2E" &&
# git rev-parse "refs/remotes/trailing_dotlock%2Elock" &&
# git rev-parse "refs/remotes/$non_reflog"
# )
#
expecting success:
(
cd project &&
git reset --hard 'refs/remotes/more%20fun%20plugin!' &&
echo hello >> foo &&
git commit -m 'hello' -- foo &&
git svn dcommit
)
fatal: ambiguous argument 'refs/remotes/more%20fun%20plugin!': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
not ok - 3 test dcommit to funky branch
#
# (
# cd project &&
# git reset --hard 'refs/remotes/more%20fun%20plugin!' &&
# echo hello >> foo &&
# git commit -m 'hello' -- foo &&
# git svn dcommit
# )
#
expecting success:
(
cd project &&
git reset --hard "refs/remotes/$scary_ref" &&
echo urls are scary >> foo &&
git commit -m "eep" -- foo &&
git svn dcommit
)
fatal: ambiguous argument 'refs/remotes/Abo-Uebernahme%20(Bug%20#994)': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
not ok - 4 test dcommit to scary branch
#
# (
# cd project &&
# git reset --hard "refs/remotes/$scary_ref" &&
# echo urls are scary >> foo &&
# git commit -m "eep" -- foo &&
# git svn dcommit
# )
#
expecting success:
(
cd project &&
git reset --hard "refs/remotes/trailing_dotlock%2Elock" &&
echo who names branches like this anyway? >> foo &&
git commit -m "bar" -- foo &&
git svn dcommit
)
fatal: ambiguous argument 'refs/remotes/trailing_dotlock%2Elock': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
not ok - 5 test dcommit to trailing_dotlock branch
#
# (
# cd project &&
# git reset --hard "refs/remotes/trailing_dotlock%2Elock" &&
# echo who names branches like this anyway? >> foo &&
# git commit -m "bar" -- foo &&
# git svn dcommit
# )
#
# failed 4 among 5 test(s)
1..5
next prev parent reply other threads:[~2012-10-23 22:58 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-28 9:38 Canonicalize the git-svn path & url accessors Michael G. Schwern
2012-07-28 9:38 ` [PATCH 1/7] Move the canonicalization functions to Git::SVN::Utils Michael G. Schwern
2012-07-28 9:38 ` [PATCH 2/7] Change canonicalize_url() to use the SVN 1.7 API when available Michael G. Schwern
2012-07-28 13:50 ` Jonathan Nieder
2012-07-28 19:01 ` Michael G Schwern
2012-07-28 19:30 ` Jonathan Nieder
2012-07-28 19:51 ` Michael G Schwern
2012-07-28 19:57 ` Jonathan Nieder
2012-07-28 20:02 ` Jonathan Nieder
2012-07-28 20:24 ` Michael G Schwern
2012-10-14 11:42 ` [PATCH/RFC 0/2] " Jonathan Nieder
2012-10-14 11:45 ` [PATCH 1/2] git svn: do not overescape URLs (fallback case) Jonathan Nieder
2012-10-14 11:48 ` [PATCH 2/2] git svn: canonicalize_url(): use svn_path_canonicalize when available Jonathan Nieder
2012-10-23 22:58 ` Eric Wong [this message]
2012-07-28 9:38 ` [PATCH 3/7] Extract, test and enhance the logic to collapse ../foo paths Michael G. Schwern
2012-07-30 19:51 ` Eric Wong
2012-07-30 20:46 ` Michael G Schwern
2012-09-26 19:45 ` Jonathan Nieder
2012-09-26 20:58 ` Eric Wong
2012-09-26 21:38 ` Jonathan Nieder
2012-09-26 21:54 ` Eric Wong
2012-09-26 22:43 ` Jonathan Nieder
2012-09-27 0:15 ` Eric Wong
2012-09-27 2:11 ` Jonathan Nieder
2012-07-28 9:38 ` [PATCH 4/7] Add join_paths() to safely concatenate paths Michael G. Schwern
2012-09-26 20:51 ` Jonathan Nieder
2012-07-28 9:38 ` [PATCH 5/7] Remove irrelevant comment Michael G. Schwern
2012-07-28 9:38 ` [PATCH 6/7] Switch path canonicalization to use the SVN API Michael G. Schwern
2012-07-28 13:55 ` Jonathan Nieder
2012-07-28 19:07 ` Michael G Schwern
2012-07-30 20:04 ` Eric Wong
2012-08-02 21:51 ` Eric Wong
2012-08-02 23:18 ` Michael G Schwern
2012-10-05 7:04 ` [PATCH] git-svn: keep leading slash when canonicalizing paths (fallback case) Jonathan Nieder
2012-10-05 23:12 ` Eric Wong
2012-10-06 5:36 ` Junio C Hamano
2012-07-28 9:38 ` [PATCH 7/7] Make Git::SVN and Git::SVN::Ra canonicalize paths and urls Michael G. Schwern
2012-07-28 14:11 ` Jonathan Nieder
2012-07-28 19:15 ` Michael G Schwern
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=20121023225812.GA21716@dcvr.yhbt.net \
--to=normalperson@yhbt$(echo .)net \
--cc=bwalton@artsci$(echo .)utoronto.ca \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
--cc=jrnieder@gmail$(echo .)com \
--cc=robbat2@gentoo$(echo .)org \
--cc=schwern@pobox$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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