{"thread":{"id":"8961","subject":"git-svn and renames","startedAt":"2007-07-10T13:11:48Z","lastAt":"2007-07-16T06:36:27Z","messageCount":10,"participants":["Rogan Dawes","David Kastrup","Florian Weimer","Eric Wong"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"46934","messageId":"46938594.2010607@dawes.za.net","threadId":"8961","inReplyTo":null,"subject":"git-svn and renames","fromName":"Rogan Dawes","fromEmail":"lists@dawes.za.net","sentAt":"2007-07-10T13:11:48Z","receivedAt":"2007-07-10T13:11:48Z","isPatch":false,"sender":{"key":"lists@dawes.za.net","avatar":null},"body":"Hi folks,\n\nI am trying to push my local changes to an imported SVN project back to \nthe SVN repo. For anyone who cares, this is the WebGoat repository which \nyou can find at http://dawes.za.net/rogan/webgoat/webgoat.git/\n\nI am trying to push it back to the primary GoogleCode repo. I have \nsuccessfully managed to push 20 or so commits, but I am now running up \nagainst a problem with a renamed/moved file.\n\nI moved a file from a directory to a subdirectory, and made minimal \nchanges to this file so that it remained a valid Java class. i.e. I \nchanged the package, and a few other minor things. As can be seen at \n<http://dawes.za.net/gitweb.cgi?p=rogan/webgoat/webgoat.git;a=commitdiff;h=486416188a3e49d60e1510166ac197e5e66cc4d2>, \n  git detects the rename with 93% similarity.\n\nHowever, when I try to push this change to the Google repo, git-svn dies \nwith the following error:\n\n$ git svn dcommit\nRA layer request failed: PROPFIND request failed on '/svn/trunk/ \nwebgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DefaultLessonAction.java': \nPROPFIND of '/svn/trunk/ \nwebgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DefaultLessonAction.java': \n400 Bad Request (https://webgoat.googlecode.com) at \n/home/rdawes/bin/git-svn line 400\n\n[Yes, those paths have a space in them, however this does not seem to \nhave prevented me from committing the previous 20 or so changes.]\n\nI noted the following in the git-svn documentation, with regards to \nhandling renames. However, I am not renaming a directory, only a couple \nof files.\n\n---- quote ----\nBUGS\n----\n\nWe ignore all SVN properties except svn:executable.  Any unhandled\nproperties are logged to $GIT_DIR/svn/<refname>/unhandled.log\n\nRenamed and copied directories are not detected by git and hence not\ntracked when committing to SVN.  I do not plan on adding support for\nthis as it's quite difficult and time-consuming to get working for all\nthe possible corner cases (git doesn't do it, either).  Committing\nrenamed and copied files are fully supported if they're similar enough\nfor git to detect them.\n---- end quote ----\n\nThis is using the latest git as of today:\n\n$ git --version\ngit version 1.5.3.rc0.81.g1ed84\n\nAny ideas?\n\nThanks\n\nRogan\n"},{"id":"46935","messageId":"86fy3wpf95.fsf@lola.quinscape.zz","threadId":"8961","inReplyTo":"46938594.2010607@dawes.za.net","subject":"Re: git-svn and renames","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2007-07-10T13:20:06Z","receivedAt":"2007-07-10T13:20:06Z","isPatch":false,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"Rogan Dawes <lists@dawes.za.net> writes:\n\n> However, when I try to push this change to the Google repo, git-svn\n> dies with the following error:\n>\n> $ git svn dcommit\n> RA layer request failed: PROPFIND request failed on '/svn/trunk/\n> webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DefaultLessonAction.java':\n> PROPFIND of '/svn/trunk/\n> webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DefaultLessonAction.java':\n> 400 Bad Request (https://webgoat.googlecode.com) at\n> /home/rdawes/bin/git-svn line 400\n>\n> [Yes, those paths have a space in them, however this does not seem to\n> have prevented me from committing the previous 20 or so changes.]\n>\n> I noted the following in the git-svn documentation, with regards to\n> handling renames. However, I am not renaming a directory, only a\n> couple of files.\n\n> ---- quote ----\n\n[...]\n>\n> Renamed and copied directories are not detected by git and hence not\n> tracked when committing to SVN.  I do not plan on adding support for\n> this as it's quite difficult and time-consuming to get working for all\n> the possible corner cases (git doesn't do it, either).  Committing\n> renamed and copied files are fully supported if they're similar enough\n> for git to detect them.\n\n> Any ideas?\n\n  dcommit          Commit several diffs to merge with upstream\n                     --quiet, -q \n                     --fetch-all, --all \n                     --no-auth-cache \n                     --no-rebase \n                     --no-checkout \n                     --rmdir \n                     --dry-run, -n \n                     --find-copies-harder \n                     --follow-parent, --follow! \n                     --authors-file, -A <arg>\n                     --copy-similarity, -C <num>\n                     --username <arg>\n                     --repack-flags, --repack-args, --repack-opts <arg>\n                     --repack <num>\n                     --verbose, -v \n                     --edit, -e \n                     --log-window-size <num>\n                     --config-dir <arg>\n                     -l <num>\n                     --merge, -m, -M \n                     --strategy, -s <arg>\n\n\nTry playing with the --copy-similarity and --find-copies-harder flags.\n\n-- \nDavid Kastrup\n"},{"id":"46941","messageId":"87odik74tx.fsf@mid.deneb.enyo.de","threadId":"8961","inReplyTo":"46938594.2010607@dawes.za.net","subject":"Re: git-svn and renames","fromName":"Florian Weimer","fromEmail":"fw@deneb.enyo.de","sentAt":"2007-07-10T13:42:34Z","receivedAt":"2007-07-10T13:42:34Z","isPatch":false,"sender":{"key":"fw@deneb.enyo.de","avatar":null},"body":"* Rogan Dawes:\n\n> $ git svn dcommit\n> RA layer request failed: PROPFIND request failed on '/svn/trunk/\n> webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DefaultLessonAction.java':\n> PROPFIND of '/svn/trunk/\n> webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DefaultLessonAction.java':\n> 400 Bad Request (https://webgoat.googlecode.com) at\n> /home/rdawes/bin/git-svn line 400\n\nDoes the \"lessons\" directory exist before that commit?\n"},{"id":"46944","messageId":"4693914C.3080701@dawes.za.net","threadId":"8961","inReplyTo":"87odik74tx.fsf@mid.deneb.enyo.de","subject":"Re: git-svn and renames","fromName":"Rogan Dawes","fromEmail":"lists@dawes.za.net","sentAt":"2007-07-10T14:01:48Z","receivedAt":"2007-07-10T14:01:48Z","isPatch":false,"sender":{"key":"lists@dawes.za.net","avatar":null},"body":"Florian Weimer wrote:\n> * Rogan Dawes:\n> \n>> $ git svn dcommit\n>> RA layer request failed: PROPFIND request failed on '/svn/trunk/\n>> webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DefaultLessonAction.java':\n>> PROPFIND of '/svn/trunk/\n>> webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DefaultLessonAction.java':\n>> 400 Bad Request (https://webgoat.googlecode.com) at\n>> /home/rdawes/bin/git-svn line 400\n> \n> Does the \"lessons\" directory exist before that commit?\n\nYes. The file was in the lessons/ directory, and was moved to \nlessons/GoatHillsFinancial/. This new directory also existed prior to \nthis commit.\n\nRogan\n"},{"id":"46949","messageId":"4693954C.90907@dawes.za.net","threadId":"8961","inReplyTo":"86fy3wpf95.fsf@lola.quinscape.zz","subject":"Re: git-svn and renames","fromName":"Rogan Dawes","fromEmail":"lists@dawes.za.net","sentAt":"2007-07-10T14:18:52Z","receivedAt":"2007-07-10T14:18:52Z","isPatch":false,"sender":{"key":"lists@dawes.za.net","avatar":null},"body":"David Kastrup wrote:\n> Rogan Dawes <lists@dawes.za.net> writes:\n> \n>> However, when I try to push this change to the Google repo, git-svn\n>> dies with the following error:\n>>\n>> $ git svn dcommit\n>> RA layer request failed: PROPFIND request failed on '/svn/trunk/\n>> webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DefaultLessonAction.java':\n>> PROPFIND of '/svn/trunk/\n>> webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DefaultLessonAction.java':\n>> 400 Bad Request (https://webgoat.googlecode.com) at\n>> /home/rdawes/bin/git-svn line 400\n>>\n>> [Yes, those paths have a space in them, however this does not seem to\n>> have prevented me from committing the previous 20 or so changes.]\n>>\n>> I noted the following in the git-svn documentation, with regards to\n>> handling renames. However, I am not renaming a directory, only a\n>> couple of files.\n> \n>> ---- quote ----\n> \n> [...]\n>> Renamed and copied directories are not detected by git and hence not\n>> tracked when committing to SVN.  I do not plan on adding support for\n>> this as it's quite difficult and time-consuming to get working for all\n>> the possible corner cases (git doesn't do it, either).  Committing\n>> renamed and copied files are fully supported if they're similar enough\n>> for git to detect them.\n> \n>> Any ideas?\n> \n>   dcommit          Commit several diffs to merge with upstream\n>                      --quiet, -q \n>                      --fetch-all, --all \n>                      --no-auth-cache \n>                      --no-rebase \n>                      --no-checkout \n>                      --rmdir \n>                      --dry-run, -n \n>                      --find-copies-harder \n>                      --follow-parent, --follow! \n>                      --authors-file, -A <arg>\n>                      --copy-similarity, -C <num>\n>                      --username <arg>\n>                      --repack-flags, --repack-args, --repack-opts <arg>\n>                      --repack <num>\n>                      --verbose, -v \n>                      --edit, -e \n>                      --log-window-size <num>\n>                      --config-dir <arg>\n>                      -l <num>\n>                      --merge, -m, -M \n>                      --strategy, -s <arg>\n> \n> \n> Try playing with the --copy-similarity and --find-copies-harder flags.\n> \n\nThanks for the suggestion.\n\nHowever, even going all the way to 50% had no impact. I get the exact \nsame message.\n\n$ git svn --find-copies-harder -C 50 dcommit\nRA layer request failed: PROPFIND request failed on '/svn/trunk/ \nwebgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DefaultLessonAction.java': \nPROPFIND of '/svn/trunk/ \nwebgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DefaultLessonAction.java': \n400 Bad Request (https://webgoat.googlecode.com) at \n/home/rdawes/bin/git-svn line 400\n\nUnfortunately, the error seems to be in the SVN::Ra library, and I can \nfind no way to enable debugging output on this code.\n\nOne thing I did note is that performing a dry-run completes successfully:\n\n$ git svn dcommit -n\ndiff-tree 486416188a3e49d60e1510166ac197e5e66cc4d2~1 \n486416188a3e49d60e1510166ac197e5e66cc4d2\ndiff-tree e0100ee6353c2160eca642ec600639004d92a99e~1 \ne0100ee6353c2160eca642ec600639004d92a99e\ndiff-tree ba64aa781efdc31a4ffceed8648ece45ac955186~1 \nba64aa781efdc31a4ffceed8648ece45ac955186\ndiff-tree 23202df6f1533bf79c0ad127fdcb06db35d8b634~1 \n23202df6f1533bf79c0ad127fdcb06db35d8b634\ndiff-tree 42af98c396e66cc2c0377e267e5431414fb8d580~1 \n42af98c396e66cc2c0377e267e5431414fb8d580\ndiff-tree 16c76a9129cb66378851bb0bec8e983354d0c936~1 \n16c76a9129cb66378851bb0bec8e983354d0c936\ndiff-tree d1a1992abfdcba1a97989c29dd0f25257b03f16a~1 \nd1a1992abfdcba1a97989c29dd0f25257b03f16a\ndiff-tree dc7071e954e33a0c859db575f3b4be767194fa7e~1 \ndc7071e954e33a0c859db575f3b4be767194fa7e\ndiff-tree 107ef202137ba38325c28b95983ded23d67cae89~1 \n107ef202137ba38325c28b95983ded23d67cae89\ndiff-tree 01891b7a0cc03234145a29582dbd5061aed0b347~1 \n01891b7a0cc03234145a29582dbd5061aed0b347\ndiff-tree f047c06823632a10379255957302698375e62d26~1 \nf047c06823632a10379255957302698375e62d26\ndiff-tree 634664ef291c5f33594202dec9f5e081348e10d2~1 \n634664ef291c5f33594202dec9f5e081348e10d2\ndiff-tree 13e731927bc32e27a240cba647f1c6425cea6247~1 \n13e731927bc32e27a240cba647f1c6425cea6247\ndiff-tree df62b0a2ef3f5556b52b933b08409dc05a2ba671~1 \ndf62b0a2ef3f5556b52b933b08409dc05a2ba671\ndiff-tree 745ec078b881cc87234a7bfe59635f7856094d8e~1 \n745ec078b881cc87234a7bfe59635f7856094d8e\ndiff-tree 91b08b5f2bc6bc1d235cb9d624be23346c5a2749~1 \n91b08b5f2bc6bc1d235cb9d624be23346c5a2749\ndiff-tree 8c1805e3be9595099832d9c55cdf740f3c20bd16~1 \n8c1805e3be9595099832d9c55cdf740f3c20bd16\ndiff-tree b06b234c5dbb046e4a56ee30f4a8b1bf17758794~1 \nb06b234c5dbb046e4a56ee30f4a8b1bf17758794\ndiff-tree 52313b6cb19fc962a7c51eacf9016870b93e2467~1 \n52313b6cb19fc962a7c51eacf9016870b93e2467\ndiff-tree 8689b19c8fc48a603c0b9992a7ba04f7e57f4e70~1 \n8689b19c8fc48a603c0b9992a7ba04f7e57f4e70\ndiff-tree 23e348e97ee5220e7514249a163647b187aa4f8b~1 \n23e348e97ee5220e7514249a163647b187aa4f8b\ndiff-tree 76479ab494bd6edfa306271be0919d4b210d1296~1 \n76479ab494bd6edfa306271be0919d4b210d1296\n\n[word wrapped, unfortunately]\n\nThanks for your help.\n\nRegards,\n\nRogan\n"},{"id":"47014","messageId":"20070711082000.GA29371@muzzle","threadId":"8961","inReplyTo":"46938594.2010607@dawes.za.net","subject":"Re: git-svn and renames","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-07-11T08:20:00Z","receivedAt":"2007-07-11T08:20:00Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Rogan Dawes <lists@dawes.za.net> wrote:\n> Hi folks,\n> \n> I am trying to push my local changes to an imported SVN project back to \n> the SVN repo. For anyone who cares, this is the WebGoat repository which \n> you can find at http://dawes.za.net/rogan/webgoat/webgoat.git/\n> \n> I am trying to push it back to the primary GoogleCode repo. I have \n> successfully managed to push 20 or so commits, but I am now running up \n> against a problem with a renamed/moved file.\n> \n> I moved a file from a directory to a subdirectory, and made minimal \n> changes to this file so that it remained a valid Java class. i.e. I \n> changed the package, and a few other minor things. As can be seen at \n> <http://dawes.za.net/gitweb.cgi?p=rogan/webgoat/webgoat.git;a=commitdiff;h=486416188a3e49d60e1510166ac197e5e66cc4d2>, \n>  git detects the rename with 93% similarity.\n> \n> However, when I try to push this change to the Google repo, git-svn dies \n> with the following error:\n> \n> $ git svn dcommit\n> RA layer request failed: PROPFIND request failed on '/svn/trunk/ \n> webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DefaultLessonAction.java': \n> PROPFIND of '/svn/trunk/ \n> webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DefaultLessonAction.java': \n> 400 Bad Request (https://webgoat.googlecode.com) at \n> /home/rdawes/bin/git-svn line 400\n> \n> [Yes, those paths have a space in them, however this does not seem to \n> have prevented me from committing the previous 20 or so changes.]\n> \n> I noted the following in the git-svn documentation, with regards to \n> handling renames. However, I am not renaming a directory, only a couple \n> of files.\n\nI've personally noted a rename issue with committing funky characters\n\"#{}\" in filenames (I was renaming to get rid of those funky characters of\ncourse).   Haven't had proper time to look into it.\n\nDid any previous successful commits have renames in them?  You may want\nto set similarity to 100% to disable rename detection.\n\n-- \nEric Wong\n"},{"id":"47132","messageId":"20070712090635.GA18155@mayonaise","threadId":"8961","inReplyTo":"20070711082000.GA29371@muzzle","subject":"Re: git-svn and renames","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-07-12T09:06:35Z","receivedAt":"2007-07-12T09:06:35Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Eric Wong <normalperson@yhbt.net> wrote:\n> Rogan Dawes <lists@dawes.za.net> wrote:\n> > Hi folks,\n> > \n> > I am trying to push my local changes to an imported SVN project back to \n> > the SVN repo. For anyone who cares, this is the WebGoat repository which \n> > you can find at http://dawes.za.net/rogan/webgoat/webgoat.git/\n> > \n> > I am trying to push it back to the primary GoogleCode repo. I have \n> > successfully managed to push 20 or so commits, but I am now running up \n> > against a problem with a renamed/moved file.\n> > \n> > I moved a file from a directory to a subdirectory, and made minimal \n> > changes to this file so that it remained a valid Java class. i.e. I \n> > changed the package, and a few other minor things. As can be seen at \n> > <http://dawes.za.net/gitweb.cgi?p=rogan/webgoat/webgoat.git;a=commitdiff;h=486416188a3e49d60e1510166ac197e5e66cc4d2>, \n> >  git detects the rename with 93% similarity.\n> > \n> > However, when I try to push this change to the Google repo, git-svn dies \n> > with the following error:\n> > \n> > $ git svn dcommit\n> > RA layer request failed: PROPFIND request failed on '/svn/trunk/ \n> > webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DefaultLessonAction.java': \n> > PROPFIND of '/svn/trunk/ \n> > webgoat/main/project/JavaSource/org/owasp/webgoat/lessons/DefaultLessonAction.java': \n> > 400 Bad Request (https://webgoat.googlecode.com) at \n> > /home/rdawes/bin/git-svn line 400\n> > \n> > [Yes, those paths have a space in them, however this does not seem to \n> > have prevented me from committing the previous 20 or so changes.]\n> > \n> > I noted the following in the git-svn documentation, with regards to \n> > handling renames. However, I am not renaming a directory, only a couple \n> > of files.\n> \n> I've personally noted a rename issue with committing funky characters\n> \"#{}\" in filenames (I was renaming to get rid of those funky characters of\n> course).   Haven't had proper time to look into it.\n> \n> Did any previous successful commits have renames in them?  You may want\n> to set similarity to 100% to disable rename detection.\n\nSVN over HTTP is most definitely behaves differently from svn:// and\nfile:// wrt strange file names.  I'll see if I can work on this again in\nday or two, or if anybody wants to pick up where I left off, my\nwork-in-progress test case is below (it's currently failing, of course).\n\nI'll have to look into how (if) svk handles it and also at the svn\ncommand-line client.  I'm fairly sure the command-line svn client\nhandles it somehow...\n\nRight now I'm getting sleepy, my vision is blurring and I'm seeing\n\"SVN\" as \"S/M\" through my tired eyes...\n\n>From 4c0165488390ad0cafb3eea700d8c873576131c2 Mon Sep 17 00:00:00 2001\nFrom: Eric Wong <normalperson@yhbt.net>\nDate: Thu, 12 Jul 2007 01:48:14 -0700\nSubject: [PATCH] git-svn: WIP test for commiting renames over DAV with funky file names\n\n---\n t/lib-git-svn.sh                         |   26 +++++++\n t/t9115-git-svn-dcommit-funky-renames.sh |   37 +++++++++++\n t/t9115/funky-names.dump                 |  105 ++++++++++++++++++++++++++++++\n 3 files changed, 168 insertions(+), 0 deletions(-)\n create mode 100755 t/t9115-git-svn-dcommit-funky-renames.sh\n create mode 100644 t/t9115/funky-names.dump\n\ndiff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh\nindex f6fe78c..60b26d4 100644\n--- a/t/lib-git-svn.sh\n+++ b/t/lib-git-svn.sh\n@@ -48,3 +48,29 @@ svnrepo=\"file://$svnrepo\"\n poke() {\n \ttest-chmtime +1 \"$1\"\n }\n+\n+SVN_HTTPD_MODULE_PATH=/usr/lib/apache2/modules\n+SVN_HTTPD_PATH=/usr/sbin/apache2\n+SVN_HTTPD_PORT=3443\n+start_httpd () {\n+mkdir $GIT_DIR/logs\n+\n+\tcat > \"$GIT_DIR/httpd.conf\" <<EOF\n+ServerName \"git-svn test\"\n+ServerRoot \"$GIT_DIR\"\n+DocumentRoot \"$GIT_DIR\"\n+PidFile \"$GIT_DIR/httpd.pid\"\n+Listen 127.0.0.1:$SVN_HTTPD_PORT\n+LoadModule dav_module $SVN_HTTPD_MODULE_PATH/mod_dav.so\n+LoadModule dav_svn_module $SVN_HTTPD_MODULE_PATH/mod_dav_svn.so\n+<Location /svn>\n+\tDAV svn\n+\tSVNPath $rawsvnrepo\n+</Location>\n+EOF\n+\t$SVN_HTTPD_PATH -f $GIT_DIR/httpd.conf -k start\n+}\n+\n+stop_httpd () {\n+\t$SVN_HTTPD_PATH -f $GIT_DIR/httpd.conf -k stop\n+}\ndiff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh\nnew file mode 100755\nindex 0000000..b451ca2\n--- /dev/null\n+++ b/t/t9115-git-svn-dcommit-funky-renames.sh\n@@ -0,0 +1,37 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2007 Eric Wong\n+\n+\n+test_description='git-svn dcommit can commit renames of files with ugly names'\n+\n+. ./lib-git-svn.sh\n+\n+test_expect_success 'load repository with strange names' \"\n+\tsvnadmin load -q $rawsvnrepo < ../t9115/funky-names.dump &&\n+\tstart_httpd\n+\"\n+\n+test_expect_success 'init and fetch repository' \"\n+\tgit svn init http://127.0.0.1:$SVN_HTTPD_PORT/svn &&\n+\tgit svn fetch &&\n+\tgit reset --hard git-svn\n+\t\"\n+\n+test_expect_success 'create file in existing ugly and empty dir' '\n+\tmkdir \"#{bad_directory_name}\" &&\n+\techo hi > \"#{bad_directory_name}/ foo\" &&\n+\tgit update-index --add \"#{bad_directory_name}/ foo\" &&\n+\tgit commit -m \"new file in ugly parent\" &&\n+\tgit svn dcommit\n+\t'\n+\n+test_expect_success 'rename ugly file' '\n+\tgit mv \"#{bad_directory_name}/ foo\" \"file name with feces\" &&\n+\tgit commit -m \"rename ugly file\" &&\n+\tgit svn dcommit --rmdir\n+\t'\n+\n+stop_httpd\n+\n+test_done\ndiff --git a/t/t9115/funky-names.dump b/t/t9115/funky-names.dump\nnew file mode 100644\nindex 0000000..da0440a\n--- /dev/null\n+++ b/t/t9115/funky-names.dump\n@@ -0,0 +1,105 @@\n+SVN-fs-dump-format-version: 2\n+\n+UUID: 819c44fe-2bcc-4066-88e4-985e2bc0b418\n+\n+Revision-number: 0\n+Prop-content-length: 56\n+Content-length: 56\n+\n+K 8\n+svn:date\n+V 27\n+2007-07-12T07:54:26.062914Z\n+PROPS-END\n+\n+Revision-number: 1\n+Prop-content-length: 152\n+Content-length: 152\n+\n+K 7\n+svn:log\n+V 44\n+what will those wacky people think of next?\n+\n+K 10\n+svn:author\n+V 12\n+normalperson\n+K 8\n+svn:date\n+V 27\n+2007-07-12T08:00:05.011573Z\n+PROPS-END\n+\n+Node-path:  leading space\n+Node-kind: dir\n+Node-action: add\n+Prop-content-length: 10\n+Content-length: 10\n+\n+PROPS-END\n+\n+\n+Node-path:  leading space file\n+Node-kind: file\n+Node-action: add\n+Prop-content-length: 10\n+Text-content-length: 5\n+Text-content-md5: e4fa20c67542cdc21271e08d329397ab\n+Content-length: 15\n+\n+PROPS-END\n+ugly\n+\n+\n+Node-path: #{bad_directory_name}\n+Node-kind: dir\n+Node-action: add\n+Prop-content-length: 10\n+Content-length: 10\n+\n+PROPS-END\n+\n+\n+Node-path: #{cool_name}\n+Node-kind: file\n+Node-action: add\n+Prop-content-length: 10\n+Text-content-length: 18\n+Text-content-md5: 87dac40ca337dfa3dcc8911388c3ddda\n+Content-length: 28\n+\n+PROPS-END\n+strange name here\n+\n+\n+Node-path: dir name with spaces\n+Node-kind: dir\n+Node-action: add\n+Prop-content-length: 10\n+Content-length: 10\n+\n+PROPS-END\n+\n+\n+Node-path: file name with spaces\n+Node-kind: file\n+Node-action: add\n+Prop-content-length: 10\n+Text-content-length: 7\n+Text-content-md5: c1f10cfd640618484a2a475c11410fd3\n+Content-length: 17\n+\n+PROPS-END\n+spaces\n+\n+\n+Node-path: regular_dir_name\n+Node-kind: dir\n+Node-action: add\n+Prop-content-length: 10\n+Content-length: 10\n+\n+PROPS-END\n+\n+\n-- \nEric Wong\n"},{"id":"47178","messageId":"46965BFD.5080702@dawes.za.net","threadId":"8961","inReplyTo":"20070712090635.GA18155@mayonaise","subject":"Re: git-svn and renames","fromName":"Rogan Dawes","fromEmail":"lists@dawes.za.net","sentAt":"2007-07-12T16:51:09Z","receivedAt":"2007-07-12T16:51:09Z","isPatch":false,"sender":{"key":"lists@dawes.za.net","avatar":null},"body":"Eric Wong wrote:\n\n>> I've personally noted a rename issue with committing funky characters\n>> \"#{}\" in filenames (I was renaming to get rid of those funky characters of\n>> course).   Haven't had proper time to look into it.\n>>\n>> Did any previous successful commits have renames in them?  You may want\n>> to set similarity to 100% to disable rename detection.\n> \n> SVN over HTTP is most definitely behaves differently from svn:// and\n> file:// wrt strange file names.  I'll see if I can work on this again in\n> day or two, or if anybody wants to pick up where I left off, my\n> work-in-progress test case is below (it's currently failing, of course).\n> \n> I'll have to look into how (if) svk handles it and also at the svn\n> command-line client.  I'm fairly sure the command-line svn client\n> handles it somehow...\n> \n> Right now I'm getting sleepy, my vision is blurring and I'm seeing\n> \"SVN\" as \"S/M\" through my tired eyes...\n> \n\nHi Eric,\n\nThis doesn't seem to be my problem. In my case, the filenames are quite \nsimple and straightforward.\n\n\nThanks\n\nRogan\n"},{"id":"47507","messageId":"20070716045350.GA15307@mayonaise","threadId":"8961","inReplyTo":"20070712090635.GA18155@mayonaise","subject":"[PATCH] git-svn: fix commiting renames over DAV with funky file names","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-07-16T04:53:50Z","receivedAt":"2007-07-16T04:53:50Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Renaming files with non-URI friendly characters caused\nbreakage when committing to DAV repositories (over http(s)).\n\nEven if I try leaving out the $self->{url} from the return value\nof url_path(), a partial (without host), unescaped path name\ndoes not work.\n\nFilenames for DAV repos need to be URI-encoded before being\npassed to the library.  Since this bug did not affect file://\nand svn:// repos, the git-svn test library needed to be expanded\nto include support for starting Apache with mod_dav_svn enabled.\n\nThis new test is not enabled by default, but can be enabled by\nsetting SVN_HTTPD_PORT to any available TCP/IP port on\n127.0.0.1.\n\nAdditionally, for running this test, the following variables\n(with defaults shown) can be changed for the suitable system.\nThe default values are set for Debian systems:\n\n  SVN_HTTPD_MODULE_PATH=/usr/lib/apache2/modules\n  SVN_HTTPD_PATH=/usr/sbin/apache2\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n\n Rogan: the patch should help, a single space anywhere in the\n path causes SVN to screw up the file names.  Of course I'm at a\n loss as to why only DAV repositories need it and why the SVN\n libraries don't abstract that away from me.\n\n git-svn.perl                             |    3 +\n t/lib-git-svn.sh                         |   34 ++++++++++\n t/t9115-git-svn-dcommit-funky-renames.sh |   54 +++++++++++++++\n t/t9115/funky-names.dump                 |  105 ++++++++++++++++++++++++++++++\n 4 files changed, 196 insertions(+), 0 deletions(-)\n create mode 100755 t/t9115-git-svn-dcommit-funky-renames.sh\n create mode 100644 t/t9115/funky-names.dump\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 299b40f..01c3904 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -2724,6 +2724,9 @@ sub repo_path {\n \n sub url_path {\n \tmy ($self, $path) = @_;\n+\tif ($self->{url} =~ m#^https?://#) {\n+\t\t$path =~ s/([^a-zA-Z0-9_.-])/uc sprintf(\"%%%02x\",ord($1))/eg;\n+\t}\n \t$self->{url} . '/' . $self->repo_path($path);\n }\n \ndiff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh\nindex f6fe78c..8d4a447 100644\n--- a/t/lib-git-svn.sh\n+++ b/t/lib-git-svn.sh\n@@ -48,3 +48,37 @@ svnrepo=\"file://$svnrepo\"\n poke() {\n \ttest-chmtime +1 \"$1\"\n }\n+\n+SVN_HTTPD_MODULE_PATH=${SVN_HTTPD_MODULE_PATH-'/usr/lib/apache2/modules'}\n+SVN_HTTPD_PATH=${SVN_HTTPD_PATH-'/usr/sbin/apache2'}\n+\n+start_httpd () {\n+\tif test -z \"$SVN_HTTPD_PORT\"\n+\tthen\n+\t\techo >&2 'SVN_HTTPD_PORT is not defined!'\n+\t\treturn\n+\tfi\n+\n+\tmkdir \"$GIT_DIR\"/logs\n+\n+\tcat > \"$GIT_DIR/httpd.conf\" <<EOF\n+ServerName \"git-svn test\"\n+ServerRoot \"$GIT_DIR\"\n+DocumentRoot \"$GIT_DIR\"\n+PidFile \"$GIT_DIR/httpd.pid\"\n+Listen 127.0.0.1:$SVN_HTTPD_PORT\n+LoadModule dav_module $SVN_HTTPD_MODULE_PATH/mod_dav.so\n+LoadModule dav_svn_module $SVN_HTTPD_MODULE_PATH/mod_dav_svn.so\n+<Location /svn>\n+\tDAV svn\n+\tSVNPath $rawsvnrepo\n+</Location>\n+EOF\n+\t\"$SVN_HTTPD_PATH\" -f \"$GIT_DIR\"/httpd.conf -k start\n+\tsvnrepo=http://127.0.0.1:$SVN_HTTPD_PORT/svn\n+}\n+\n+stop_httpd () {\n+\ttest -z \"$SVN_HTTPD_PORT\" && return\n+\t\"$SVN_HTTPD_PATH\" -f \"$GIT_DIR\"/httpd.conf -k stop\n+}\ndiff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh\nnew file mode 100755\nindex 0000000..182299c\n--- /dev/null\n+++ b/t/t9115-git-svn-dcommit-funky-renames.sh\n@@ -0,0 +1,54 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2007 Eric Wong\n+\n+\n+test_description='git-svn dcommit can commit renames of files with ugly names'\n+\n+. ./lib-git-svn.sh\n+\n+test_expect_success 'load repository with strange names' \"\n+\tsvnadmin load -q $rawsvnrepo < ../t9115/funky-names.dump &&\n+\tstart_httpd\n+\t\"\n+\n+test_expect_success 'init and fetch repository' \"\n+\tgit svn init $svnrepo &&\n+\tgit svn fetch &&\n+\tgit reset --hard git-svn\n+\t\"\n+\n+test_expect_success 'create file in existing ugly and empty dir' '\n+\tmkdir \"#{bad_directory_name}\" &&\n+\techo hi > \"#{bad_directory_name}/ foo\" &&\n+\tgit update-index --add \"#{bad_directory_name}/ foo\" &&\n+\tgit commit -m \"new file in ugly parent\" &&\n+\tgit svn dcommit\n+\t'\n+\n+test_expect_success 'rename ugly file' '\n+\tgit mv \"#{bad_directory_name}/ foo\" \"file name with feces\" &&\n+\tgit commit -m \"rename ugly file\" &&\n+\tgit svn dcommit\n+\t'\n+\n+test_expect_success 'rename pretty file' '\n+\techo :x > pretty &&\n+\tgit update-index --add pretty &&\n+\tgit commit -m \"pretty :x\" &&\n+\tgit svn dcommit &&\n+\tmkdir regular_dir_name &&\n+\tgit mv pretty regular_dir_name/pretty &&\n+\tgit commit -m \"moved pretty file\" &&\n+\tgit svn dcommit\n+\t'\n+\n+test_expect_success 'rename pretty file into ugly one' '\n+\tgit mv regular_dir_name/pretty \"#{bad_directory_name}/ booboo\" &&\n+\tgit commit -m booboo &&\n+\tgit svn dcommit\n+\t'\n+\n+stop_httpd\n+\n+test_done\ndiff --git a/t/t9115/funky-names.dump b/t/t9115/funky-names.dump\nnew file mode 100644\nindex 0000000..da0440a\n--- /dev/null\n+++ b/t/t9115/funky-names.dump\n@@ -0,0 +1,105 @@\n+SVN-fs-dump-format-version: 2\n+\n+UUID: 819c44fe-2bcc-4066-88e4-985e2bc0b418\n+\n+Revision-number: 0\n+Prop-content-length: 56\n+Content-length: 56\n+\n+K 8\n+svn:date\n+V 27\n+2007-07-12T07:54:26.062914Z\n+PROPS-END\n+\n+Revision-number: 1\n+Prop-content-length: 152\n+Content-length: 152\n+\n+K 7\n+svn:log\n+V 44\n+what will those wacky people think of next?\n+\n+K 10\n+svn:author\n+V 12\n+normalperson\n+K 8\n+svn:date\n+V 27\n+2007-07-12T08:00:05.011573Z\n+PROPS-END\n+\n+Node-path:  leading space\n+Node-kind: dir\n+Node-action: add\n+Prop-content-length: 10\n+Content-length: 10\n+\n+PROPS-END\n+\n+\n+Node-path:  leading space file\n+Node-kind: file\n+Node-action: add\n+Prop-content-length: 10\n+Text-content-length: 5\n+Text-content-md5: e4fa20c67542cdc21271e08d329397ab\n+Content-length: 15\n+\n+PROPS-END\n+ugly\n+\n+\n+Node-path: #{bad_directory_name}\n+Node-kind: dir\n+Node-action: add\n+Prop-content-length: 10\n+Content-length: 10\n+\n+PROPS-END\n+\n+\n+Node-path: #{cool_name}\n+Node-kind: file\n+Node-action: add\n+Prop-content-length: 10\n+Text-content-length: 18\n+Text-content-md5: 87dac40ca337dfa3dcc8911388c3ddda\n+Content-length: 28\n+\n+PROPS-END\n+strange name here\n+\n+\n+Node-path: dir name with spaces\n+Node-kind: dir\n+Node-action: add\n+Prop-content-length: 10\n+Content-length: 10\n+\n+PROPS-END\n+\n+\n+Node-path: file name with spaces\n+Node-kind: file\n+Node-action: add\n+Prop-content-length: 10\n+Text-content-length: 7\n+Text-content-md5: c1f10cfd640618484a2a475c11410fd3\n+Content-length: 17\n+\n+PROPS-END\n+spaces\n+\n+\n+Node-path: regular_dir_name\n+Node-kind: dir\n+Node-action: add\n+Prop-content-length: 10\n+Content-length: 10\n+\n+PROPS-END\n+\n+\n-- \n1.5.3.rc2.1.g4e223\n\n-- \nEric Wong\n"},{"id":"47518","messageId":"469B11EB.8020003@dawes.za.net","threadId":"8961","inReplyTo":"20070716045350.GA15307@mayonaise","subject":"Re: [PATCH] git-svn: fix commiting renames over DAV with funky file names","fromName":"Rogan Dawes","fromEmail":"lists@dawes.za.net","sentAt":"2007-07-16T06:36:27Z","receivedAt":"2007-07-16T06:36:27Z","isPatch":true,"sender":{"key":"lists@dawes.za.net","avatar":null},"body":"Eric Wong wrote:\n> Renaming files with non-URI friendly characters caused\n> breakage when committing to DAV repositories (over http(s)).\n> \n> Even if I try leaving out the $self->{url} from the return value\n> of url_path(), a partial (without host), unescaped path name\n> does not work.\n> \n> Filenames for DAV repos need to be URI-encoded before being\n> passed to the library.  Since this bug did not affect file://\n> and svn:// repos, the git-svn test library needed to be expanded\n> to include support for starting Apache with mod_dav_svn enabled.\n> \n> This new test is not enabled by default, but can be enabled by\n> setting SVN_HTTPD_PORT to any available TCP/IP port on\n> 127.0.0.1.\n> \n> Additionally, for running this test, the following variables\n> (with defaults shown) can be changed for the suitable system.\n> The default values are set for Debian systems:\n> \n>   SVN_HTTPD_MODULE_PATH=/usr/lib/apache2/modules\n>   SVN_HTTPD_PATH=/usr/sbin/apache2\n> \n> Signed-off-by: Eric Wong <normalperson@yhbt.net>\n> ---\n> \n>  Rogan: the patch should help, a single space anywhere in the\n>  path causes SVN to screw up the file names.  Of course I'm at a\n>  loss as to why only DAV repositories need it and why the SVN\n>  libraries don't abstract that away from me.\n> \n\nHi Eric,\n\nUnfortunately, I cannot test this patch, as I have since worked around \nthe problem, and it has not reappeared.\n\nIf it does, I'll be sure to test and let you know. Unless this patch \nmakes it into the version of git I am using, of course!\n\nRogan\n"}]}