All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] t9117: test specifying full url to git svn init -T
@ 2016-03-16 19:09 Adam Dinwoodie
  2016-03-16 19:34 ` Eric Wong
  2016-03-16 20:14 ` [PATCH 2/1] git-svn: fix URL canonicalization during init w/ SVN 1.7+ Eric Wong
  0 siblings, 2 replies; 4+ messages in thread
From: Adam Dinwoodie @ 2016-03-16 19:09 UTC (permalink / raw)
  To: git; +Cc: Eric Wong, Michael G. Schwern

According to the documentation, full URLs can be specified in the `-T`
argument to `git svn init`.  However, the canonicalization of such
arguments squashes together consecutive "/"s, which unsurprisingly
breaks http://, svn://, etc URLs.  Add a failing test case to provide
evidence of that.

On systems where Subversion provides svn_path_canonicalize but not
svn_dirent_canonicalize (Subversion 1.6 and earlier?), this test passes,
as svn_path_canonicalize doesn't mangle the consecutive "/"s.

Signed-off-by: Adam Dinwoodie <adam@dinwoodie.org>
---

I think the bug here is in using perl/Git/SVN/Utils.pm's
`canonicalize_path` on the `-T` argument.  If it's available, that
function calls Subversion's `svn_dirent_canonicalize`.  The Subversion
code[0] makes it clear that this function is fine for relative and
absolute local paths, and for UNC paths on Windows, but it isn't
suitable for use on URLs.

[0]: https://svn.apache.org/repos/asf/subversion/trunk/subversion/include/svn_dirent_uri.h

It occurs to me that the correct "fix" here may simply be to stop
claiming support for specifying URLs as arguments to -T, and mandate
users use the `git svn init $url -T $dirent` syntax instead, but I
figured providing the failing testcase would be a good start to that
discussion regardless.

 t/t9117-git-svn-init-clone.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/t/t9117-git-svn-init-clone.sh b/t/t9117-git-svn-init-clone.sh
index a66f43c..2ba003d 100755
--- a/t/t9117-git-svn-init-clone.sh
+++ b/t/t9117-git-svn-init-clone.sh
@@ -119,4 +119,10 @@ test_expect_success 'clone with -s/-T/-b/-t and --prefix "" still works' '
        rm -f warning
        '

+test_expect_failure 'init with -T as a full url works' '
+       test ! -d project &&
+       git svn init -T "$svnrepo"/project/trunk project &&
+       rm -rf project
+       '
+
 test_done
--
2.7.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-03-16 22:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-16 19:09 [PATCH] t9117: test specifying full url to git svn init -T Adam Dinwoodie
2016-03-16 19:34 ` Eric Wong
2016-03-16 22:34   ` Adam Dinwoodie
2016-03-16 20:14 ` [PATCH 2/1] git-svn: fix URL canonicalization during init w/ SVN 1.7+ Eric Wong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.