{"thread":{"id":"15210","subject":"[PATCH 0/6] 'git svn info' fixes","startedAt":"2008-08-26T19:32:31Z","lastAt":"2008-09-01T22:58:31Z","messageCount":17,"participants":["Thomas Rast","Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"88637","messageId":"1219779157-31602-1-git-send-email-trast@student.ethz.ch","threadId":"15210","inReplyTo":null,"subject":"[PATCH 0/6] 'git svn info' fixes","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2008-08-26T19:32:31Z","receivedAt":"2008-08-26T19:32:31Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Actually, I only wanted to do 5/6 (git svn info: make info relative to\nthe current directory).  This seemed like a fairly simple change, see\nthe corresponding mail.\n\nHowever, I also wanted to provide tests, and that's where the fun\nstarted.  Turns out t9119-git-svn-info.sh is currently quite broken.\n1-4 just fix the tests; a brief summary:\n\n[1/6] git svn info: tests: let 'init' test run with SVN 1.5\n\n  The tests do not report any problems with 1.5.\n\n[2/6] git svn info: tests: do not use set -e\n\n  No idea how 'set -e' ever got in there; it completely breaks the\n  test script in case of an error.\n\n[3/6] git svn info: tests: use test_cmp instead of git-diff\n\n  git-diff does not correctly report the exit status (IIRC that is\n  caused by the pager setup code?), which used to hide a lot of\n  errors.\n\n[4/6] git svn info: tests: fix ptouch argument order in setup\n\n  Swapped arguments caused ptouch to fail and tests to break.\n\nYes, I'm just whoring commit karma here, so feel free to squash these\nfour into one if you like it better that way.\n\nAfter these, 22 of 37 tests (all except --url, plus all unknown files)\nfail. Most of them are caused by 'git svn info' not URL-encoding the\nURL and Repository fields in the output, as SVN does.  6/6 fixes\nthis.\n\nHowever, the unknown files tests still fail, simply because 'svn info'\nitself fails on untracked files.  It would be great if someone who is\nstill running SVN 1.4 could check whether that has been a bug in\ngit-svn all along, or is actually a behaviour change on the part of\nSVN.\n\nOh, and let's hope I did the splitting right this time :-)\n\n\n git-svn.perl            |   30 +++++++++++--\n t/t9119-git-svn-info.sh |  102 ++++++++++++++++++++++++++---------------------\n 2 files changed, 82 insertions(+), 50 deletions(-)\n"},{"id":"88639","messageId":"1219779157-31602-2-git-send-email-trast@student.ethz.ch","threadId":"15210","inReplyTo":"1219779157-31602-1-git-send-email-trast@student.ethz.ch","subject":"[PATCH 1/6] git svn info: tests: let 'init' test run with SVN 1.5","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2008-08-26T19:32:32Z","receivedAt":"2008-08-26T19:32:32Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Signed-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n t/t9119-git-svn-info.sh |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t9119-git-svn-info.sh b/t/t9119-git-svn-info.sh\nindex 5fd36a1..46676bc 100755\n--- a/t/t9119-git-svn-info.sh\n+++ b/t/t9119-git-svn-info.sh\n@@ -9,9 +9,9 @@ test_description='git-svn info'\n set -e\n \n # Tested with: svn, version 1.4.4 (r25188)\n-v=`svn --version | sed -n -e 's/^svn, version \\(1\\.4\\.[0-9]\\).*$/\\1/p'`\n+v=`svn --version | sed -n -e 's/^svn, version \\(1\\.[0-9]*\\.[0-9]*\\).*$/\\1/p'`\n case $v in\n-1.4.*)\n+1.[45].*)\n \t;;\n *)\n \tsay \"skipping svn-info test (SVN version: $v not supported)\"\n-- \n1.6.0.1.96.g9307e.dirty\n"},{"id":"88638","messageId":"1219779157-31602-3-git-send-email-trast@student.ethz.ch","threadId":"15210","inReplyTo":"1219779157-31602-2-git-send-email-trast@student.ethz.ch","subject":"[PATCH 2/6] git svn info: tests: do not use set -e","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2008-08-26T19:32:33Z","receivedAt":"2008-08-26T19:32:33Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Exiting in the middle of a test confuses the test suite, which will\njust say \"FATAL: Unexpected exit with code 1\" in response to a failed\ntest, instead of actually diagnosing failure and continuing with the\nnext test.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n t/t9119-git-svn-info.sh |    2 --\n 1 files changed, 0 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t9119-git-svn-info.sh b/t/t9119-git-svn-info.sh\nindex 46676bc..a70f2b9 100755\n--- a/t/t9119-git-svn-info.sh\n+++ b/t/t9119-git-svn-info.sh\n@@ -6,8 +6,6 @@ test_description='git-svn info'\n \n . ./lib-git-svn.sh\n \n-set -e\n-\n # Tested with: svn, version 1.4.4 (r25188)\n v=`svn --version | sed -n -e 's/^svn, version \\(1\\.[0-9]*\\.[0-9]*\\).*$/\\1/p'`\n case $v in\n-- \n1.6.0.1.96.g9307e.dirty\n"},{"id":"88642","messageId":"1219779157-31602-4-git-send-email-trast@student.ethz.ch","threadId":"15210","inReplyTo":"1219779157-31602-3-git-send-email-trast@student.ethz.ch","subject":"[PATCH 3/6] git svn info: tests: use test_cmp instead of git-diff","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2008-08-26T19:32:34Z","receivedAt":"2008-08-26T19:32:34Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"git-diff does not appear to return the correct exit values, and gives\na false success for more than half (!) of the tests due to the space\nin \"trash directory\" which git-svn fails to encode.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n t/t9119-git-svn-info.sh |   44 ++++++++++++++++++++++----------------------\n 1 files changed, 22 insertions(+), 22 deletions(-)\n\ndiff --git a/t/t9119-git-svn-info.sh b/t/t9119-git-svn-info.sh\nindex a70f2b9..7798dcc 100755\n--- a/t/t9119-git-svn-info.sh\n+++ b/t/t9119-git-svn-info.sh\n@@ -60,7 +60,7 @@ test_expect_success 'setup repository and import' '\n test_expect_success 'info' \"\n \t(cd svnwc; svn info) > expected.info &&\n \t(cd gitwc; git-svn info) > actual.info &&\n-\tgit-diff expected.info actual.info\n+\ttest_cmp expected.info actual.info\n \t\"\n \n test_expect_success 'info --url' '\n@@ -70,7 +70,7 @@ test_expect_success 'info --url' '\n test_expect_success 'info .' \"\n \t(cd svnwc; svn info .) > expected.info-dot &&\n \t(cd gitwc; git-svn info .) > actual.info-dot &&\n-\tgit-diff expected.info-dot actual.info-dot\n+\ttest_cmp expected.info-dot actual.info-dot\n \t\"\n \n test_expect_success 'info --url .' '\n@@ -80,7 +80,7 @@ test_expect_success 'info --url .' '\n test_expect_success 'info file' \"\n \t(cd svnwc; svn info file) > expected.info-file &&\n \t(cd gitwc; git-svn info file) > actual.info-file &&\n-\tgit-diff expected.info-file actual.info-file\n+\ttest_cmp expected.info-file actual.info-file\n \t\"\n \n test_expect_success 'info --url file' '\n@@ -90,7 +90,7 @@ test_expect_success 'info --url file' '\n test_expect_success 'info directory' \"\n \t(cd svnwc; svn info directory) > expected.info-directory &&\n \t(cd gitwc; git-svn info directory) > actual.info-directory &&\n-\tgit-diff expected.info-directory actual.info-directory\n+\ttest_cmp expected.info-directory actual.info-directory\n \t\"\n \n test_expect_success 'info --url directory' '\n@@ -100,7 +100,7 @@ test_expect_success 'info --url directory' '\n test_expect_success 'info symlink-file' \"\n \t(cd svnwc; svn info symlink-file) > expected.info-symlink-file &&\n \t(cd gitwc; git-svn info symlink-file) > actual.info-symlink-file &&\n-\tgit-diff expected.info-symlink-file actual.info-symlink-file\n+\ttest_cmp expected.info-symlink-file actual.info-symlink-file\n \t\"\n \n test_expect_success 'info --url symlink-file' '\n@@ -113,7 +113,7 @@ test_expect_success 'info symlink-directory' \"\n \t\t> expected.info-symlink-directory &&\n \t(cd gitwc; git-svn info symlink-directory) \\\n \t\t> actual.info-symlink-directory &&\n-\tgit-diff expected.info-symlink-directory actual.info-symlink-directory\n+\ttest_cmp expected.info-symlink-directory actual.info-symlink-directory\n \t\"\n \n test_expect_success 'info --url symlink-directory' '\n@@ -133,7 +133,7 @@ test_expect_success 'info added-file' \"\n \tcd .. &&\n \t(cd svnwc; svn info added-file) > expected.info-added-file &&\n \t(cd gitwc; git-svn info added-file) > actual.info-added-file &&\n-\tgit-diff expected.info-added-file actual.info-added-file\n+\ttest_cmp expected.info-added-file actual.info-added-file\n \t\"\n \n test_expect_success 'info --url added-file' '\n@@ -155,7 +155,7 @@ test_expect_success 'info added-directory' \"\n \t\t> expected.info-added-directory &&\n \t(cd gitwc; git-svn info added-directory) \\\n \t\t> actual.info-added-directory &&\n-\tgit-diff expected.info-added-directory actual.info-added-directory\n+\ttest_cmp expected.info-added-directory actual.info-added-directory\n \t\"\n \n test_expect_success 'info --url added-directory' '\n@@ -177,7 +177,7 @@ test_expect_success 'info added-symlink-file' \"\n \t\t> expected.info-added-symlink-file &&\n \t(cd gitwc; git-svn info added-symlink-file) \\\n \t\t> actual.info-added-symlink-file &&\n-\tgit-diff expected.info-added-symlink-file \\\n+\ttest_cmp expected.info-added-symlink-file \\\n \t\t actual.info-added-symlink-file\n \t\"\n \n@@ -200,7 +200,7 @@ test_expect_success 'info added-symlink-directory' \"\n \t\t> expected.info-added-symlink-directory &&\n \t(cd gitwc; git-svn info added-symlink-directory) \\\n \t\t> actual.info-added-symlink-directory &&\n-\tgit-diff expected.info-added-symlink-directory \\\n+\ttest_cmp expected.info-added-symlink-directory \\\n \t\t actual.info-added-symlink-directory\n \t\"\n \n@@ -227,7 +227,7 @@ test_expect_success 'info deleted-file' \"\n \t(cd gitwc; git-svn info file) |\n \tsed -e 's/^\\(Text Last Updated:\\).*/\\1 TEXT-LAST-UPDATED-STRING/' \\\n \t\t> actual.info-deleted-file &&\n-\tgit-diff expected.info-deleted-file actual.info-deleted-file\n+\ttest_cmp expected.info-deleted-file actual.info-deleted-file\n \t\"\n \n test_expect_success 'info --url file (deleted)' '\n@@ -248,7 +248,7 @@ test_expect_success 'info deleted-directory' \"\n \t(cd gitwc; git-svn info directory) |\n \tsed -e 's/^\\(Text Last Updated:\\).*/\\1 TEXT-LAST-UPDATED-STRING/' \\\n \t\t> actual.info-deleted-directory &&\n-\tgit-diff expected.info-deleted-directory actual.info-deleted-directory\n+\ttest_cmp expected.info-deleted-directory actual.info-deleted-directory\n \t\"\n \n test_expect_success 'info --url directory (deleted)' '\n@@ -269,7 +269,7 @@ test_expect_success 'info deleted-symlink-file' \"\n \t(cd gitwc; git-svn info symlink-file) |\n \tsed -e 's/^\\(Text Last Updated:\\).*/\\1 TEXT-LAST-UPDATED-STRING/' \\\n \t\t> actual.info-deleted-symlink-file &&\n-\tgit-diff expected.info-deleted-symlink-file \\\n+\ttest_cmp expected.info-deleted-symlink-file \\\n \t\t actual.info-deleted-symlink-file\n \t\"\n \n@@ -291,7 +291,7 @@ test_expect_success 'info deleted-symlink-directory' \"\n \t(cd gitwc; git-svn info symlink-directory) |\n \tsed -e 's/^\\(Text Last Updated:\\).*/\\1 TEXT-LAST-UPDATED-STRING/' \\\n \t\t > actual.info-deleted-symlink-directory &&\n-\tgit-diff expected.info-deleted-symlink-directory \\\n+\ttest_cmp expected.info-deleted-symlink-directory \\\n \t\t actual.info-deleted-symlink-directory\n \t\"\n \n@@ -309,13 +309,13 @@ test_expect_success 'info unknown-file' \"\n \tptouch gitwc/unknown-file svnwc/unknown-file &&\n \t(cd svnwc; svn info unknown-file) 2> expected.info-unknown-file &&\n \t(cd gitwc; git-svn info unknown-file) 2> actual.info-unknown-file &&\n-\tgit-diff expected.info-unknown-file actual.info-unknown-file\n+\ttest_cmp expected.info-unknown-file actual.info-unknown-file\n \t\"\n \n test_expect_success 'info --url unknown-file' '\n \ttest -z \"$(cd gitwc; git-svn info --url unknown-file \\\n \t\t\t2> ../actual.info--url-unknown-file)\" &&\n-\tgit-diff expected.info-unknown-file actual.info--url-unknown-file\n+\ttest_cmp expected.info-unknown-file actual.info--url-unknown-file\n \t'\n \n test_expect_success 'info unknown-directory' \"\n@@ -326,13 +326,13 @@ test_expect_success 'info unknown-directory' \"\n \t\t2> expected.info-unknown-directory &&\n \t(cd gitwc; git-svn info unknown-directory) \\\n \t\t2> actual.info-unknown-directory &&\n-\tgit-diff expected.info-unknown-directory actual.info-unknown-directory\n+\ttest_cmp expected.info-unknown-directory actual.info-unknown-directory\n \t\"\n \n test_expect_success 'info --url unknown-directory' '\n \ttest -z \"$(cd gitwc; git-svn info --url unknown-directory \\\n \t\t\t2> ../actual.info--url-unknown-directory)\" &&\n-\tgit-diff expected.info-unknown-directory \\\n+\ttest_cmp expected.info-unknown-directory \\\n \t\t actual.info--url-unknown-directory\n \t'\n \n@@ -348,14 +348,14 @@ test_expect_success 'info unknown-symlink-file' \"\n \t\t2> expected.info-unknown-symlink-file &&\n \t(cd gitwc; git-svn info unknown-symlink-file) \\\n \t\t2> actual.info-unknown-symlink-file &&\n-\tgit-diff expected.info-unknown-symlink-file \\\n+\ttest_cmp expected.info-unknown-symlink-file \\\n \t\t actual.info-unknown-symlink-file\n \t\"\n \n test_expect_success 'info --url unknown-symlink-file' '\n \ttest -z \"$(cd gitwc; git-svn info --url unknown-symlink-file \\\n \t\t\t2> ../actual.info--url-unknown-symlink-file)\" &&\n-\tgit-diff expected.info-unknown-symlink-file \\\n+\ttest_cmp expected.info-unknown-symlink-file \\\n \t\t actual.info--url-unknown-symlink-file\n \t'\n \n@@ -372,14 +372,14 @@ test_expect_success 'info unknown-symlink-directory' \"\n \t\t2> expected.info-unknown-symlink-directory &&\n \t(cd gitwc; git-svn info unknown-symlink-directory) \\\n \t\t2> actual.info-unknown-symlink-directory &&\n-\tgit-diff expected.info-unknown-symlink-directory \\\n+\ttest_cmp expected.info-unknown-symlink-directory \\\n \t\t actual.info-unknown-symlink-directory\n \t\"\n \n test_expect_success 'info --url unknown-symlink-directory' '\n \ttest -z \"$(cd gitwc; git-svn info --url unknown-symlink-directory \\\n \t\t\t2> ../actual.info--url-unknown-symlink-directory)\" &&\n-\tgit-diff expected.info-unknown-symlink-directory \\\n+\ttest_cmp expected.info-unknown-symlink-directory \\\n \t\t actual.info--url-unknown-symlink-directory\n \t'\n \n-- \n1.6.0.1.96.g9307e.dirty\n"},{"id":"88641","messageId":"1219779157-31602-5-git-send-email-trast@student.ethz.ch","threadId":"15210","inReplyTo":"1219779157-31602-4-git-send-email-trast@student.ethz.ch","subject":"[PATCH 4/6] git svn info: tests: fix ptouch argument order in setup","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2008-08-26T19:32:35Z","receivedAt":"2008-08-26T19:32:35Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"The arguments must be <gitwc-path> <svnwc-path>, otherwise it fails to\nupdate the timestamps (without setting a failure exit code) and\nresults in bad test output later on.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n t/t9119-git-svn-info.sh |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t9119-git-svn-info.sh b/t/t9119-git-svn-info.sh\nindex 7798dcc..821507d 100755\n--- a/t/t9119-git-svn-info.sh\n+++ b/t/t9119-git-svn-info.sh\n@@ -51,10 +51,10 @@ test_expect_success 'setup repository and import' '\n \t\tgit-svn fetch &&\n \tcd .. &&\n \tsvn co \"$svnrepo\" svnwc &&\n-\tptouch svnwc/file gitwc/file &&\n-\tptouch svnwc/directory gitwc/directory &&\n-\tptouch svnwc/symlink-file gitwc/symlink-file &&\n-\tptouch svnwc/symlink-directory gitwc/symlink-directory\n+\tptouch gitwc/file svnwc/file &&\n+\tptouch gitwc/directory svnwc/directory &&\n+\tptouch gitwc/symlink-file svnwc/symlink-file &&\n+\tptouch gitwc/symlink-directory svnwc/symlink-directory\n \t'\n \n test_expect_success 'info' \"\n-- \n1.6.0.1.96.g9307e.dirty\n"},{"id":"88643","messageId":"1219779157-31602-6-git-send-email-trast@student.ethz.ch","threadId":"15210","inReplyTo":"1219779157-31602-5-git-send-email-trast@student.ethz.ch","subject":"[PATCH 5/6] git svn info: make info relative to the current directory","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2008-08-26T19:32:36Z","receivedAt":"2008-08-26T19:32:36Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Previously 'git svn info <path>' would always treat the <path> as\nrelative to the working directory root, with a default of \".\".  This\ndoes not match the behaviour of 'svn info'.  Prepend $(git rev-parse\n--show-prefix) to the path used inside cmd_info to make it relative to\nthe current working directory.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n\nI realise that this might break things for people who rely on the\ncurrent behaviour, but looking at the tests, the goal is to imitate\n'svn info' as closely as possible.  This also matches my use case of\n'svn info || git svn info', which is why I stumbled over the problem\nin the first place.\n\n\n git-svn.perl            |    5 +++--\n t/t9119-git-svn-info.sh |   14 +++++++++++++-\n 2 files changed, 16 insertions(+), 3 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 7a1d26d..46bc0b0 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -805,6 +805,7 @@ sub cmd_commit_diff {\n \n sub cmd_info {\n \tmy $path = canonicalize_path(defined($_[0]) ? $_[0] : \".\");\n+\tmy $fullpath = canonicalize_path($cmd_dir_prefix . $path);\n \tif (exists $_[1]) {\n \t\tdie \"Too many arguments specified\\n\";\n \t}\n@@ -825,7 +826,7 @@ sub cmd_info {\n \t# canonicalize_path() will return \"\" to make libsvn 1.5.x happy,\n \t$path = \".\" if $path eq \"\";\n \n-\tmy $full_url = $url . ($path eq \".\" ? \"\" : \"/$path\");\n+\tmy $full_url = $url . ($fullpath eq \"\" ? \"\" : \"/$fullpath\");\n \n \tif ($_url) {\n \t\tprint $full_url, \"\\n\";\n@@ -861,7 +862,7 @@ sub cmd_info {\n \t}\n \n \tmy ($lc_author, $lc_rev, $lc_date_utc);\n-\tmy @args = Git::SVN::Log::git_svn_log_cmd($rev, $rev, \"--\", $path);\n+\tmy @args = Git::SVN::Log::git_svn_log_cmd($rev, $rev, \"--\", $fullpath);\n \tmy $log = command_output_pipe(@args);\n \tmy $esc_color = qr/(?:\\033\\[(?:(?:\\d+;)*\\d*)?m)*/;\n \twhile (<$log>) {\ndiff --git a/t/t9119-git-svn-info.sh b/t/t9119-git-svn-info.sh\nindex 821507d..8709bcc 100755\n--- a/t/t9119-git-svn-info.sh\n+++ b/t/t9119-git-svn-info.sh\n@@ -45,12 +45,18 @@ test_expect_success 'setup repository and import' '\n \t\tln -s directory symlink-directory &&\n \t\tsvn import -m \"initial\" . \"$svnrepo\" &&\n \tcd .. &&\n+\tsvn co \"$svnrepo\" svnwc &&\n+\tcd svnwc &&\n+\t\techo foo > foo &&\n+\t\tsvn add foo &&\n+\t\tsvn commit -m \"change outside directory\" &&\n+\t\tsvn update &&\n+\tcd .. &&\n \tmkdir gitwc &&\n \tcd gitwc &&\n \t\tgit-svn init \"$svnrepo\" &&\n \t\tgit-svn fetch &&\n \tcd .. &&\n-\tsvn co \"$svnrepo\" svnwc &&\n \tptouch gitwc/file svnwc/file &&\n \tptouch gitwc/directory svnwc/directory &&\n \tptouch gitwc/symlink-file svnwc/symlink-file &&\n@@ -93,6 +99,12 @@ test_expect_success 'info directory' \"\n \ttest_cmp expected.info-directory actual.info-directory\n \t\"\n \n+test_expect_success 'info inside directory' \"\n+\t(cd svnwc/directory; svn info) > expected.info-inside-directory &&\n+\t(cd gitwc/directory; git-svn info) > actual.info-inside-directory &&\n+\ttest_cmp expected.info-inside-directory actual.info-inside-directory\n+\t\"\n+\n test_expect_success 'info --url directory' '\n \ttest \"$(cd gitwc; git-svn info --url directory)\" = \"$svnrepo/directory\"\n \t'\n-- \n1.6.0.1.96.g9307e.dirty\n"},{"id":"88640","messageId":"1219779157-31602-7-git-send-email-trast@student.ethz.ch","threadId":"15210","inReplyTo":"1219779157-31602-6-git-send-email-trast@student.ethz.ch","subject":"[PATCH 6/6] git svn info: always quote URLs in 'info' output","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2008-08-26T19:32:37Z","receivedAt":"2008-08-26T19:32:37Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Changes 'git svn info' to always URL-escape the 'URL' and 'Repository'\nfields and --url output, like SVN (at least 1.5) does.\n\nNote that reusing the escape_url() further down in Git::SVN::Ra is not\npossible because it only triggers for http(s) URLs.  I did not know\nwhether extending it to all schemes would break SVN access anywhere,\nso I made a new one that quotes in all schemes.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n\nI wasn't sure if I should quote --url too.  It is not an 'svn info'\nfeature, so we could do it either way.  Eventually I decided for the\nchange to be consistent with the 'URL:' field of normal output.  If\nthis breaks scripts for someone, I can change it back.\n\n git-svn.perl            |   25 ++++++++++++++++++++++---\n t/t9119-git-svn-info.sh |   30 ++++++++++++++++--------------\n 2 files changed, 38 insertions(+), 17 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 46bc0b0..11ff813 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -803,6 +803,25 @@ sub cmd_commit_diff {\n \t}\n }\n \n+sub escape_uri_only {\n+\tmy ($uri) = @_;\n+\tmy @tmp;\n+\tforeach (split m{/}, $uri) {\n+\t\ts/([^\\w.%+-]|%(?![a-fA-F0-9]{2}))/sprintf(\"%%%02X\",ord($1))/eg;\n+\t\tpush @tmp, $_;\n+\t}\n+\tjoin('/', @tmp);\n+}\n+\n+sub escape_url {\n+\tmy ($url) = @_;\n+\tif ($url =~ m#^([^:]+)://([^/]*)(.*)$#) {\n+\t\tmy ($scheme, $domain, $uri) = ($1, $2, escape_uri_only($3));\n+\t\t$url = \"$scheme://$domain$uri\";\n+\t}\n+\t$url;\n+}\n+\n sub cmd_info {\n \tmy $path = canonicalize_path(defined($_[0]) ? $_[0] : \".\");\n \tmy $fullpath = canonicalize_path($cmd_dir_prefix . $path);\n@@ -829,18 +848,18 @@ sub cmd_info {\n \tmy $full_url = $url . ($fullpath eq \"\" ? \"\" : \"/$fullpath\");\n \n \tif ($_url) {\n-\t\tprint $full_url, \"\\n\";\n+\t\tprint escape_url($full_url), \"\\n\";\n \t\treturn;\n \t}\n \n \tmy $result = \"Path: $path\\n\";\n \t$result .= \"Name: \" . basename($path) . \"\\n\" if $file_type ne \"dir\";\n-\t$result .= \"URL: \" . $full_url . \"\\n\";\n+\t$result .= \"URL: \" . escape_url($full_url) . \"\\n\";\n \n \teval {\n \t\tmy $repos_root = $gs->repos_root;\n \t\tGit::SVN::remove_username($repos_root);\n-\t\t$result .= \"Repository Root: $repos_root\\n\";\n+\t\t$result .= \"Repository Root: \" . escape_url($repos_root) . \"\\n\";\n \t};\n \tif ($@) {\n \t\t$result .= \"Repository Root: (offline)\\n\";\ndiff --git a/t/t9119-git-svn-info.sh b/t/t9119-git-svn-info.sh\nindex 8709bcc..1811010 100755\n--- a/t/t9119-git-svn-info.sh\n+++ b/t/t9119-git-svn-info.sh\n@@ -34,6 +34,8 @@ ptouch() {\n \t' \"`svn info $2 | grep '^Text Last Updated:'`\" \"$1\"\n }\n \n+quoted_svnrepo=\"$(echo $svnrepo | sed 's/ /%20/')\"\n+\n test_expect_success 'setup repository and import' '\n \tmkdir info &&\n \tcd info &&\n@@ -70,7 +72,7 @@ test_expect_success 'info' \"\n \t\"\n \n test_expect_success 'info --url' '\n-\ttest \"$(cd gitwc; git-svn info --url)\" = \"$svnrepo\"\n+\ttest \"$(cd gitwc; git-svn info --url)\" = \"$quoted_svnrepo\"\n \t'\n \n test_expect_success 'info .' \"\n@@ -80,7 +82,7 @@ test_expect_success 'info .' \"\n \t\"\n \n test_expect_success 'info --url .' '\n-\ttest \"$(cd gitwc; git-svn info --url .)\" = \"$svnrepo\"\n+\ttest \"$(cd gitwc; git-svn info --url .)\" = \"$quoted_svnrepo\"\n \t'\n \n test_expect_success 'info file' \"\n@@ -90,7 +92,7 @@ test_expect_success 'info file' \"\n \t\"\n \n test_expect_success 'info --url file' '\n-\ttest \"$(cd gitwc; git-svn info --url file)\" = \"$svnrepo/file\"\n+\ttest \"$(cd gitwc; git-svn info --url file)\" = \"$quoted_svnrepo/file\"\n \t'\n \n test_expect_success 'info directory' \"\n@@ -106,7 +108,7 @@ test_expect_success 'info inside directory' \"\n \t\"\n \n test_expect_success 'info --url directory' '\n-\ttest \"$(cd gitwc; git-svn info --url directory)\" = \"$svnrepo/directory\"\n+\ttest \"$(cd gitwc; git-svn info --url directory)\" = \"$quoted_svnrepo/directory\"\n \t'\n \n test_expect_success 'info symlink-file' \"\n@@ -117,7 +119,7 @@ test_expect_success 'info symlink-file' \"\n \n test_expect_success 'info --url symlink-file' '\n \ttest \"$(cd gitwc; git-svn info --url symlink-file)\" \\\n-\t     = \"$svnrepo/symlink-file\"\n+\t     = \"$quoted_svnrepo/symlink-file\"\n \t'\n \n test_expect_success 'info symlink-directory' \"\n@@ -130,7 +132,7 @@ test_expect_success 'info symlink-directory' \"\n \n test_expect_success 'info --url symlink-directory' '\n \ttest \"$(cd gitwc; git-svn info --url symlink-directory)\" \\\n-\t     = \"$svnrepo/symlink-directory\"\n+\t     = \"$quoted_svnrepo/symlink-directory\"\n \t'\n \n test_expect_success 'info added-file' \"\n@@ -150,7 +152,7 @@ test_expect_success 'info added-file' \"\n \n test_expect_success 'info --url added-file' '\n \ttest \"$(cd gitwc; git-svn info --url added-file)\" \\\n-\t     = \"$svnrepo/added-file\"\n+\t     = \"$quoted_svnrepo/added-file\"\n \t'\n \n test_expect_success 'info added-directory' \"\n@@ -172,7 +174,7 @@ test_expect_success 'info added-directory' \"\n \n test_expect_success 'info --url added-directory' '\n \ttest \"$(cd gitwc; git-svn info --url added-directory)\" \\\n-\t     = \"$svnrepo/added-directory\"\n+\t     = \"$quoted_svnrepo/added-directory\"\n \t'\n \n test_expect_success 'info added-symlink-file' \"\n@@ -195,7 +197,7 @@ test_expect_success 'info added-symlink-file' \"\n \n test_expect_success 'info --url added-symlink-file' '\n \ttest \"$(cd gitwc; git-svn info --url added-symlink-file)\" \\\n-\t     = \"$svnrepo/added-symlink-file\"\n+\t     = \"$quoted_svnrepo/added-symlink-file\"\n \t'\n \n test_expect_success 'info added-symlink-directory' \"\n@@ -218,7 +220,7 @@ test_expect_success 'info added-symlink-directory' \"\n \n test_expect_success 'info --url added-symlink-directory' '\n \ttest \"$(cd gitwc; git-svn info --url added-symlink-directory)\" \\\n-\t     = \"$svnrepo/added-symlink-directory\"\n+\t     = \"$quoted_svnrepo/added-symlink-directory\"\n \t'\n \n # The next few tests replace the \"Text Last Updated\" value with a\n@@ -244,7 +246,7 @@ test_expect_success 'info deleted-file' \"\n \n test_expect_success 'info --url file (deleted)' '\n \ttest \"$(cd gitwc; git-svn info --url file)\" \\\n-\t     = \"$svnrepo/file\"\n+\t     = \"$quoted_svnrepo/file\"\n \t'\n \n test_expect_success 'info deleted-directory' \"\n@@ -265,7 +267,7 @@ test_expect_success 'info deleted-directory' \"\n \n test_expect_success 'info --url directory (deleted)' '\n \ttest \"$(cd gitwc; git-svn info --url directory)\" \\\n-\t     = \"$svnrepo/directory\"\n+\t     = \"$quoted_svnrepo/directory\"\n \t'\n \n test_expect_success 'info deleted-symlink-file' \"\n@@ -287,7 +289,7 @@ test_expect_success 'info deleted-symlink-file' \"\n \n test_expect_success 'info --url symlink-file (deleted)' '\n \ttest \"$(cd gitwc; git-svn info --url symlink-file)\" \\\n-\t     = \"$svnrepo/symlink-file\"\n+\t     = \"$quoted_svnrepo/symlink-file\"\n \t'\n \n test_expect_success 'info deleted-symlink-directory' \"\n@@ -309,7 +311,7 @@ test_expect_success 'info deleted-symlink-directory' \"\n \n test_expect_success 'info --url symlink-directory (deleted)' '\n \ttest \"$(cd gitwc; git-svn info --url symlink-directory)\" \\\n-\t     = \"$svnrepo/symlink-directory\"\n+\t     = \"$quoted_svnrepo/symlink-directory\"\n \t'\n \n # NOTE: git does not have the concept of replaced objects,\n-- \n1.6.0.1.96.g9307e.dirty\n"},{"id":"88715","messageId":"20080827094312.GA26475@untitled","threadId":"15210","inReplyTo":"1219779157-31602-7-git-send-email-trast@student.ethz.ch","subject":"Re: [PATCH 6/6] git svn info: always quote URLs in 'info' output","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-08-27T09:43:12Z","receivedAt":"2008-08-27T09:43:12Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Thomas Rast <trast@student.ethz.ch> wrote:\n> Changes 'git svn info' to always URL-escape the 'URL' and 'Repository'\n> fields and --url output, like SVN (at least 1.5) does.\n> \n> Note that reusing the escape_url() further down in Git::SVN::Ra is not\n> possible because it only triggers for http(s) URLs.  I did not know\n> whether extending it to all schemes would break SVN access anywhere,\n> so I made a new one that quotes in all schemes.\n\nThanks for keeping them separate. I seem to recall there being places\nwhere paths must not be escaped in SVN.\n\n-- \nEric Wong\n"},{"id":"88716","messageId":"20080827095342.GB26475@untitled","threadId":"15210","inReplyTo":"1219779157-31602-1-git-send-email-trast@student.ethz.ch","subject":"Re: [PATCH 0/6] 'git svn info' fixes","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-08-27T09:53:42Z","receivedAt":"2008-08-27T09:53:42Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Thomas Rast <trast@student.ethz.ch> wrote:\n> However, I also wanted to provide tests, and that's where the fun\n> started.  Turns out t9119-git-svn-info.sh is currently quite broken.\n> 1-4 just fix the tests; a brief summary:\n> \n> [1/6] git svn info: tests: let 'init' test run with SVN 1.5\n> \n>   The tests do not report any problems with 1.5.\n> \n> [2/6] git svn info: tests: do not use set -e\n> \n>   No idea how 'set -e' ever got in there; it completely breaks the\n>   test script in case of an error.\n\nI have a habit of using set -e in my scripts since I often\nforget (or am too lazy) to check for errors when executing\na series of commands.\n\n> [4/6] git svn info: tests: fix ptouch argument order in setup\n> \n>   Swapped arguments caused ptouch to fail and tests to break.\n\nHm... I seem to remember explicitly setting the arguments one\nway for one reason or another.\n\n> Yes, I'm just whoring commit karma here, so feel free to squash these\n> four into one if you like it better that way.\n> \n> After these, 22 of 37 tests (all except --url, plus all unknown files)\n> fail. Most of them are caused by 'git svn info' not URL-encoding the\n> URL and Repository fields in the output, as SVN does.  6/6 fixes\n> this.\n> \n> However, the unknown files tests still fail, simply because 'svn info'\n> itself fails on untracked files.  It would be great if someone who is\n> still running SVN 1.4 could check whether that has been a bug in\n> git-svn all along, or is actually a behaviour change on the part of\n> SVN.\n\nOops, I upgraded to 1.5.x here already.  I should still have\nanother machine with 1.4 to check on tomorrow, though.\n\n-- \nEric Wong\n"},{"id":"88990","messageId":"200808281031.04975.trast@student.ethz.ch","threadId":"15210","inReplyTo":"20080827095342.GB26475@untitled","subject":"Re: [PATCH 0/6] 'git svn info' fixes","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2008-08-28T08:30:58Z","receivedAt":"2008-08-28T08:30:58Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Eric Wong wrote:\n> Thomas Rast <trast@student.ethz.ch> wrote:\n> > However, the unknown files tests still fail, simply because 'svn info'\n> > itself fails on untracked files.  It would be great if someone who is\n> > still running SVN 1.4 could check whether that has been a bug in\n> > git-svn all along, or is actually a behaviour change on the part of\n> > SVN.\n> \n> Oops, I upgraded to 1.5.x here already.  I should still have\n> another machine with 1.4 to check on tomorrow, though.\n\nI got a friend with 1.4 to test this, and it appears the error\n\n  $ touch new\n  $ svn info new\n  new:  (Keine versionierte Ressource)\n\n(literally \"not a versioned resource\") is already present in\n\n  $ svn --version\n  svn, Version 1.4.6 (r28521)\n\n(He also says the error is the same if the file does not exist at\nall.)\n\nSo should we just change all \"unknown foo\" tests to verify that 'git\nsvn info' errors out too?\n\n- Thomas\n\n-- \nThomas Rast\ntrast@student.ethz.ch\n\n"},{"id":"89099","messageId":"20080829081654.GA6680@yp-box.dyndns.org","threadId":"15210","inReplyTo":"200808281031.04975.trast@student.ethz.ch","subject":"Re: [PATCH 0/6] 'git svn info' fixes","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-08-29T08:16:54Z","receivedAt":"2008-08-29T08:16:54Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Thomas Rast <trast@student.ethz.ch> wrote:\n> Eric Wong wrote:\n> > Thomas Rast <trast@student.ethz.ch> wrote:\n> > > However, the unknown files tests still fail, simply because 'svn info'\n> > > itself fails on untracked files.  It would be great if someone who is\n> > > still running SVN 1.4 could check whether that has been a bug in\n> > > git-svn all along, or is actually a behaviour change on the part of\n> > > SVN.\n> > \n> > Oops, I upgraded to 1.5.x here already.  I should still have\n> > another machine with 1.4 to check on tomorrow, though.\n> \n> I got a friend with 1.4 to test this, and it appears the error\n> \n>   $ touch new\n>   $ svn info new\n>   new:  (Keine versionierte Ressource)\n> \n> (literally \"not a versioned resource\") is already present in\n> \n>   $ svn --version\n>   svn, Version 1.4.6 (r28521)\n> \n> (He also says the error is the same if the file does not exist at\n> all.)\n\nInteresting.\n\n> So should we just change all \"unknown foo\" tests to verify that 'git\n> svn info' errors out too?\n\nYes, I see no reason to differ from plain svn here.\n\n-- \nEric Wong\n"},{"id":"89132","messageId":"1220017369-32637-1-git-send-email-trast@student.ethz.ch","threadId":"15210","inReplyTo":"20080829081654.GA6680@yp-box.dyndns.org","subject":"[PATCH 0/2] *** SUBJECT HERE ***","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2008-08-29T13:42:47Z","receivedAt":"2008-08-29T13:42:47Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Eric Wong wrote.\n> > So should we just change all \"unknown foo\" tests to verify that 'git\n> > svn info' errors out too?\n>\n> Yes, I see no reason to differ from plain svn here.\n\nThis starts getting more complicated at every turn.  The included\nmini-series (probably textually depends on the other 6 patches though)\n\"fixes\" this.\n\nHOWEVER: Subversion itself broke compatibility here.  In 1.4:\n\n  $ svn info new; echo $?\n  new:  (Not a versioned resource)\n\n  0\n\nNote the extra linebreak and successful exit.  Current git-svn\nprecisely matches this output.  In 1.5, it's different:\n\n  $ svn info new; echo $?\n  svn: 'new' is not under version control\n  1\n\nWhile it is of course up to you what you would like to do (and modulo\ntest_must_fail, 2/2 can still be used to fix the tests if you decide\nto reject 1/2), I suggest changing to 1.5 behaviour.  exit(1) is the\nsane thing to do in this case, and that is already breaking\nbit-for-bit compatibility with SVN 1.4, so we might as well adopt the\nnew error message.  Of course this prevents us from comparing the\noutput literally in the tests, so I settled for a slightly weaker\ncheck: failure status and mention of the filename.\n\nUnfortunately this does raise the question whether the URL-encoding\nissue treated in the other series is in fact a similar incompatibility\nbetween 1.4 and 1.5, not a (minor but long-standing) bug in git-svn.\n\n- Thomas\n\n\n git-svn.perl            |    4 +-\n t/t9119-git-svn-info.sh |   73 ++++++++++++++++-------------------------------\n 2 files changed, 27 insertions(+), 50 deletions(-)\n"},{"id":"89131","messageId":"1220017369-32637-2-git-send-email-trast@student.ethz.ch","threadId":"15210","inReplyTo":"1220017369-32637-1-git-send-email-trast@student.ethz.ch","subject":"[PATCH 1/2] git-svn: match SVN 1.5 behaviour of info' on unknown item","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2008-08-29T13:42:48Z","receivedAt":"2008-08-29T13:42:48Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Previously 'git svn info unknown-file' only announced its failure (in\nthe SVN 1.4 style, \"not a versioned resource\"), and exited\nsuccessfully.\n\nIt is desirable to actually exit with failure, so change the code to\nexit(1) under this condition.  Since that is already halfway SVN 1.5\ncompatibility, also change the error output to match 1.5.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n git-svn.perl |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 11ff813..bc181e0 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -832,8 +832,8 @@ sub cmd_info {\n \tmy ($file_type, $diff_status) = find_file_type_and_diff_status($path);\n \n \tif (!$file_type && !$diff_status) {\n-\t\tprint STDERR \"$path:  (Not a versioned resource)\\n\\n\";\n-\t\treturn;\n+\t\tprint STDERR \"svn: '$path' is not under version control\\n\";\n+\t\texit 1;\n \t}\n \n \tmy ($url, $rev, $uuid, $gs) = working_head_info('HEAD');\n-- \n1.6.0.1.98.g76a24\n"},{"id":"89133","messageId":"1220017369-32637-3-git-send-email-trast@student.ethz.ch","threadId":"15210","inReplyTo":"1220017369-32637-2-git-send-email-trast@student.ethz.ch","subject":"[PATCH 2/2] git-svn: fix 'info' tests for unknown items","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2008-08-29T13:42:49Z","receivedAt":"2008-08-29T13:42:49Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"The previous tests all expected the results from SVN and Git to be\nidentical, and expected both to return success.  This cannot be\nguaranteed: SVN changed the message style between 1.4 and 1.5, and\nin 1.5, sets a failure exit code.\n\nChange the tests to verify that 'git svn info <item>' sets a failure\nexit code, and that its output contains the file name.  This should\nhopefully catch all other errors.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n t/t9119-git-svn-info.sh |   73 ++++++++++++++++-------------------------------\n 1 files changed, 25 insertions(+), 48 deletions(-)\n\ndiff --git a/t/t9119-git-svn-info.sh b/t/t9119-git-svn-info.sh\nindex 1811010..3e48459 100755\n--- a/t/t9119-git-svn-info.sh\n+++ b/t/t9119-git-svn-info.sh\n@@ -319,82 +319,59 @@ test_expect_success 'info --url symlink-directory (deleted)' '\n \n test_expect_success 'info unknown-file' \"\n \techo two > gitwc/unknown-file &&\n-\tcp gitwc/unknown-file svnwc/unknown-file &&\n-\tptouch gitwc/unknown-file svnwc/unknown-file &&\n-\t(cd svnwc; svn info unknown-file) 2> expected.info-unknown-file &&\n-\t(cd gitwc; git-svn info unknown-file) 2> actual.info-unknown-file &&\n-\ttest_cmp expected.info-unknown-file actual.info-unknown-file\n+\t(cd gitwc; test_must_fail git-svn info unknown-file) \\\n+\t\t 2> actual.info-unknown-file &&\n+\tgrep unknown-file actual.info-unknown-file\n \t\"\n \n test_expect_success 'info --url unknown-file' '\n-\ttest -z \"$(cd gitwc; git-svn info --url unknown-file \\\n-\t\t\t2> ../actual.info--url-unknown-file)\" &&\n-\ttest_cmp expected.info-unknown-file actual.info--url-unknown-file\n+\techo two > gitwc/unknown-file &&\n+\t(cd gitwc; test_must_fail git-svn info --url unknown-file) \\\n+\t\t 2> actual.info-url-unknown-file &&\n+\tgrep unknown-file actual.info-url-unknown-file\n \t'\n \n test_expect_success 'info unknown-directory' \"\n \tmkdir gitwc/unknown-directory svnwc/unknown-directory &&\n-\tptouch gitwc/unknown-directory svnwc/unknown-directory &&\n-\ttouch gitwc/unknown-directory/.placeholder &&\n-\t(cd svnwc; svn info unknown-directory) \\\n-\t\t2> expected.info-unknown-directory &&\n-\t(cd gitwc; git-svn info unknown-directory) \\\n-\t\t2> actual.info-unknown-directory &&\n-\ttest_cmp expected.info-unknown-directory actual.info-unknown-directory\n+\t(cd gitwc; test_must_fail git-svn info unknown-directory) \\\n+\t\t 2> actual.info-unknown-directory &&\n+\tgrep unknown-directory actual.info-unknown-directory\n \t\"\n \n test_expect_success 'info --url unknown-directory' '\n-\ttest -z \"$(cd gitwc; git-svn info --url unknown-directory \\\n-\t\t\t2> ../actual.info--url-unknown-directory)\" &&\n-\ttest_cmp expected.info-unknown-directory \\\n-\t\t actual.info--url-unknown-directory\n+\t(cd gitwc; test_must_fail git-svn info --url unknown-directory) \\\n+\t\t 2> actual.info-url-unknown-directory &&\n+\tgrep unknown-directory actual.info-url-unknown-directory\n \t'\n \n test_expect_success 'info unknown-symlink-file' \"\n \tcd gitwc &&\n \t\tln -s unknown-file unknown-symlink-file &&\n \tcd .. &&\n-\tcd svnwc &&\n-\t\tln -s unknown-file unknown-symlink-file &&\n-\tcd .. &&\n-\tptouch gitwc/unknown-symlink-file svnwc/unknown-symlink-file &&\n-\t(cd svnwc; svn info unknown-symlink-file) \\\n-\t\t2> expected.info-unknown-symlink-file &&\n-\t(cd gitwc; git-svn info unknown-symlink-file) \\\n-\t\t2> actual.info-unknown-symlink-file &&\n-\ttest_cmp expected.info-unknown-symlink-file \\\n-\t\t actual.info-unknown-symlink-file\n+\t(cd gitwc; test_must_fail git-svn info unknown-symlink-file) \\\n+\t\t 2> actual.info-unknown-symlink-file &&\n+\tgrep unknown-symlink-file actual.info-unknown-symlink-file\n \t\"\n \n test_expect_success 'info --url unknown-symlink-file' '\n-\ttest -z \"$(cd gitwc; git-svn info --url unknown-symlink-file \\\n-\t\t\t2> ../actual.info--url-unknown-symlink-file)\" &&\n-\ttest_cmp expected.info-unknown-symlink-file \\\n-\t\t actual.info--url-unknown-symlink-file\n+\t(cd gitwc; test_must_fail git-svn info --url unknown-symlink-file) \\\n+\t\t 2> actual.info-url-unknown-symlink-file &&\n+\tgrep unknown-symlink-file actual.info-url-unknown-symlink-file\n \t'\n \n test_expect_success 'info unknown-symlink-directory' \"\n \tcd gitwc &&\n \t\tln -s unknown-directory unknown-symlink-directory &&\n \tcd .. &&\n-\tcd svnwc &&\n-\t\tln -s unknown-directory unknown-symlink-directory &&\n-\tcd .. &&\n-\tptouch gitwc/unknown-symlink-directory \\\n-\t       svnwc/unknown-symlink-directory &&\n-\t(cd svnwc; svn info unknown-symlink-directory) \\\n-\t\t2> expected.info-unknown-symlink-directory &&\n-\t(cd gitwc; git-svn info unknown-symlink-directory) \\\n-\t\t2> actual.info-unknown-symlink-directory &&\n-\ttest_cmp expected.info-unknown-symlink-directory \\\n-\t\t actual.info-unknown-symlink-directory\n+\t(cd gitwc; test_must_fail git-svn info unknown-symlink-directory) \\\n+\t\t 2> actual.info-unknown-symlink-directory &&\n+\tgrep unknown-symlink-directory actual.info-unknown-symlink-directory\n \t\"\n \n test_expect_success 'info --url unknown-symlink-directory' '\n-\ttest -z \"$(cd gitwc; git-svn info --url unknown-symlink-directory \\\n-\t\t\t2> ../actual.info--url-unknown-symlink-directory)\" &&\n-\ttest_cmp expected.info-unknown-symlink-directory \\\n-\t\t actual.info--url-unknown-symlink-directory\n+\t(cd gitwc; test_must_fail git-svn info --url unknown-symlink-directory) \\\n+\t\t 2> actual.info-url-unknown-symlink-directory &&\n+\tgrep unknown-symlink-directory actual.info-url-unknown-symlink-directory\n \t'\n \n test_done\n-- \n1.6.0.1.98.g76a24\n"},{"id":"89185","messageId":"20080830010319.GA2940@untitled","threadId":"15210","inReplyTo":"1220017369-32637-1-git-send-email-trast@student.ethz.ch","subject":"Re: [PATCH 0/2] 'git svn info' fixes","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-08-30T01:03:19Z","receivedAt":"2008-08-30T01:03:19Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Thomas Rast <trast@student.ethz.ch> wrote:\n> Eric Wong wrote.\n> > > So should we just change all \"unknown foo\" tests to verify that 'git\n> > > svn info' errors out too?\n> >\n> > Yes, I see no reason to differ from plain svn here.\n> \n> This starts getting more complicated at every turn.  The included\n> mini-series (probably textually depends on the other 6 patches though)\n> \"fixes\" this.\n> \n> HOWEVER: Subversion itself broke compatibility here.  In 1.4:\n> \n>   $ svn info new; echo $?\n>   new:  (Not a versioned resource)\n> \n>   0\n> \n> Note the extra linebreak and successful exit.  Current git-svn\n> precisely matches this output.  In 1.5, it's different:\n> \n>   $ svn info new; echo $?\n>   svn: 'new' is not under version control\n>   1\n> \n> While it is of course up to you what you would like to do (and modulo\n> test_must_fail, 2/2 can still be used to fix the tests if you decide\n> to reject 1/2), I suggest changing to 1.5 behaviour.  exit(1) is the\n> sane thing to do in this case, and that is already breaking\n> bit-for-bit compatibility with SVN 1.4, so we might as well adopt the\n> new error message.  Of course this prevents us from comparing the\n> output literally in the tests, so I settled for a slightly weaker\n> check: failure status and mention of the filename.\n\nYes.  Please maintain compatibility with svn 1.5.  The current version\nof git-svn should strive to maintain compatibility with the current\nversion of svn whenever possible.\n\n> Unfortunately this does raise the question whether the URL-encoding\n> issue treated in the other series is in fact a similar incompatibility\n> between 1.4 and 1.5, not a (minor but long-standing) bug in git-svn.\n\nIt should match svn 1.5 for \"git svn info\".\n\nSince \"git svn info --url\" is a git-svn-only thing, whatever makes the\nmost sense from a command-line scripting perspective (I don't have time\nto check against a real repo right now):\n\nFor git-svn info --url, just want things like:\n\n\tsvn log -v `git svn info --url`\n\n\tsvn cp `git svn info --url` \\\n               `git svn info --url | sed -e 's,/trunk,/tags/1.0,'`\n\n\tsvn rm `git svn info --url`\n\nto just work.\n\nI seem to recall the rules being slightly different for http(s):// and\n(file://|svn://) URLs with the command-line client; but my memory may\njust be fuzzy...\n\nThanks for looking into this!\n\n-- \nEric Wong\n"},{"id":"89385","messageId":"200809011146.44909.trast@student.ethz.ch","threadId":"15210","inReplyTo":"20080830010319.GA2940@untitled","subject":"Re: [PATCH 0/2] 'git svn info' fixes","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2008-09-01T09:46:42Z","receivedAt":"2008-09-01T09:46:42Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Eric Wong wrote:\n> Yes.  Please maintain compatibility with svn 1.5.  The current version\n> of git-svn should strive to maintain compatibility with the current\n> version of svn whenever possible.\n\nOk, that certainly clarifies the goal.\n\n> > Unfortunately this does raise the question whether the URL-encoding\n> > issue treated in the other series is in fact a similar incompatibility\n> > between 1.4 and 1.5, not a (minor but long-standing) bug in git-svn.\n> \n> It should match svn 1.5 for \"git svn info\".\n[...]\n> \tsvn log -v `git svn info --url`\n> [should] just work.\n> \n> I seem to recall the rules being slightly different for http(s):// and\n> (file://|svn://) URLs with the command-line client; but my memory may\n> just be fuzzy...\n\nI've finally found a system with SVN 1.4 that I have access to, and\nran a few tests.  I don't have svn:// servers with weird directory\nnames at hand, but I could verify that even SVN 1.4 quotes output and\nrequires the input to be properly quoted:\n\n  $ svn info\n  Path: .\n  URL: file:///home/thomas/test%20directory%3F\n  Repository Root: file:///home/thomas/test%20directory%3F\n  [...]\n\n  $ svn info file:///home/thomas/test%20directory%3F\n  Path: test directory?\n  URL: file:///home/thomas/test%20directory%3F\n  Repository Root: file:///home/thomas/test%20directory%3F\n  [...]\n\n  $ svn info file:///home/thomas/'test directory?'\n  svn: URL 'file:///home/thomas/test directory?' is not properly URI-encoded\n\nVariations with https:// and SVN 1.5 give the same results.  So unless\nI'm missing something, the two patch series are needed to get the\ncorrect output.\n\n- Thomas\n\n-- \nThomas Rast\ntrast@student.ethz.ch\n\n\n"},{"id":"89454","messageId":"20080901225831.GA26913@untitled","threadId":"15210","inReplyTo":"200809011146.44909.trast@student.ethz.ch","subject":"Re: [PATCH 0/2] 'git svn info' fixes","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-09-01T22:58:31Z","receivedAt":"2008-09-01T22:58:31Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Thomas Rast <trast@student.ethz.ch> wrote:\n> Eric Wong wrote:\n> > Yes.  Please maintain compatibility with svn 1.5.  The current version\n> > of git-svn should strive to maintain compatibility with the current\n> > version of svn whenever possible.\n> \n> Ok, that certainly clarifies the goal.\n> \n> > > Unfortunately this does raise the question whether the URL-encoding\n> > > issue treated in the other series is in fact a similar incompatibility\n> > > between 1.4 and 1.5, not a (minor but long-standing) bug in git-svn.\n> > \n> > It should match svn 1.5 for \"git svn info\".\n> [...]\n> > \tsvn log -v `git svn info --url`\n> > [should] just work.\n> > \n> > I seem to recall the rules being slightly different for http(s):// and\n> > (file://|svn://) URLs with the command-line client; but my memory may\n> > just be fuzzy...\n> \n> I've finally found a system with SVN 1.4 that I have access to, and\n> ran a few tests.  I don't have svn:// servers with weird directory\n> names at hand, but I could verify that even SVN 1.4 quotes output and\n> requires the input to be properly quoted:\n> \n>   $ svn info\n>   Path: .\n>   URL: file:///home/thomas/test%20directory%3F\n>   Repository Root: file:///home/thomas/test%20directory%3F\n>   [...]\n> \n>   $ svn info file:///home/thomas/test%20directory%3F\n>   Path: test directory?\n>   URL: file:///home/thomas/test%20directory%3F\n>   Repository Root: file:///home/thomas/test%20directory%3F\n>   [...]\n> \n>   $ svn info file:///home/thomas/'test directory?'\n>   svn: URL 'file:///home/thomas/test directory?' is not properly URI-encoded\n> \n> Variations with https:// and SVN 1.5 give the same results.  So unless\n> I'm missing something, the two patch series are needed to get the\n> correct output.\n\nThank you very much for the fixes an analysis.  This series acked and\npushed out to git://git.bogomips.org/git-svn.git\n\n-- \nEric Wong\n"}]}