{"thread":{"id":"12781","subject":"[PATCH resend 1/2] Make git-svn tests behave better on OS X","startedAt":"2008-03-20T20:08:48Z","lastAt":"2008-03-22T19:35:18Z","messageCount":8,"participants":["Kevin Ballard","Eric Wong","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"72538","messageId":"1206043729-61810-1-git-send-email-kevin@sb.org","threadId":"12781","inReplyTo":null,"subject":"[PATCH resend 1/2] Make git-svn tests behave better on OS X","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2008-03-20T20:08:48Z","receivedAt":"2008-03-20T20:08:48Z","isPatch":true,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"Give lib-git-svn.sh some better defaults for OS X.\nExplicitly define the LockFile so httpd will actually start under OS X\n\nSigned-off-by: Kevin Ballard <kevin@sb.org>\n---\n t/lib-git-svn.sh |   11 +++++++++--\n 1 files changed, 9 insertions(+), 2 deletions(-)\n\ndiff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh\nindex 9ee35e7..1266609 100644\n--- a/t/lib-git-svn.sh\n+++ b/t/lib-git-svn.sh\n@@ -49,8 +49,14 @@ 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+if test `uname -s` = Darwin\n+then\n+\tSVN_HTTPD_MODULE_PATH=${SVN_HTTPD_MODULE_PATH-'/usr/libexec/apache2'}\n+\tSVN_HTTPD_PATH=${SVN_HTTPD_PATH-'/usr/sbin/httpd'}\n+else\n+\tSVN_HTTPD_MODULE_PATH=${SVN_HTTPD_MODULE_PATH-'/usr/lib/apache2/modules'}\n+\tSVN_HTTPD_PATH=${SVN_HTTPD_PATH-'/usr/sbin/apache2'}\n+fi\n \n start_httpd () {\n \tif test -z \"$SVN_HTTPD_PORT\"\n@@ -66,6 +72,7 @@ ServerName \"git-svn test\"\n ServerRoot \"$GIT_DIR\"\n DocumentRoot \"$GIT_DIR\"\n PidFile \"$GIT_DIR/httpd.pid\"\n+LockFile logs/accept.lock\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-- \n1.5.5.rc0.10.g0fd43\n"},{"id":"72539","messageId":"1206043729-61810-2-git-send-email-kevin@sb.org","threadId":"12781","inReplyTo":"1206043729-61810-1-git-send-email-kevin@sb.org","subject":"[PATCH resend 2/2] Don't try and percent-escape existing percent escapes in git-svn URIs","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2008-03-20T20:08:49Z","receivedAt":"2008-03-20T20:08:49Z","isPatch":true,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"git-svn: project names are percent-escaped ever since f5530b.\nUnfortunately this breaks the scenario where the user hands git-svn\nan already-escaped URI. Fix the regexp to skip over what looks like\nexisting percent escapes, and test this scenario.\n\nSigned-off-by: Kevin Ballard <kevin@sb.org>\n---\n git-svn.perl                                  |    2 +-\n t/t9120-git-svn-clone-with-percent-escapes.sh |   31 +++++++++++++++++++++++++\n 2 files changed, 32 insertions(+), 1 deletions(-)\n create mode 100755 t/t9120-git-svn-clone-with-percent-escapes.sh\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex bba22c1..0c2b791 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -3665,7 +3665,7 @@ sub escape_uri_only {\n \tmy ($uri) = @_;\n \tmy @tmp;\n \tforeach (split m{/}, $uri) {\n-\t\ts/([^\\w.-])/sprintf(\"%%%02X\",ord($1))/eg;\n+\t\ts/([^\\w.%-]|%(?![a-fA-F0-9]{2}))/sprintf(\"%%%02X\",ord($1))/eg;\n \t\tpush @tmp, $_;\n \t}\n \tjoin('/', @tmp);\ndiff --git a/t/t9120-git-svn-clone-with-percent-escapes.sh b/t/t9120-git-svn-clone-with-percent-escapes.sh\nnew file mode 100755\nindex 0000000..9a4eabe\n--- /dev/null\n+++ b/t/t9120-git-svn-clone-with-percent-escapes.sh\n@@ -0,0 +1,31 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2008 Kevin Ballard\n+#\n+\n+test_description='git-svn clone with percent escapes'\n+. ./lib-git-svn.sh\n+\n+test_expect_success 'setup svnrepo' \"\n+\tmkdir project project/trunk project/branches project/tags &&\n+\techo foo > project/trunk/foo &&\n+\tsvn import -m '$test_description' project '$svnrepo/pr ject' &&\n+\trm -rf project &&\n+\tstart_httpd\n+\"\n+\n+if test \"$SVN_HTTPD_PORT\" = \"\"\n+then\n+\ttest_expect_failure 'test clone with percent escapes - needs SVN_HTTPD_PORT set' 'false'\n+else\n+\ttest_expect_success 'test clone with percent escapes' '\n+\t\tgit svn clone \"$svnrepo/pr%20ject\" clone &&\n+\t\tcd clone &&\n+\t\t\tgit rev-parse refs/remotes/git-svn &&\n+\t\tcd ..\n+\t'\n+fi\n+\n+stop_httpd\n+\n+test_done\n-- \n1.5.5.rc0.10.g0fd43\n"},{"id":"72576","messageId":"20080321065130.GA28144@muzzle","threadId":"12781","inReplyTo":"1206043729-61810-2-git-send-email-kevin@sb.org","subject":"Re: [PATCH resend 2/2] Don't try and percent-escape existing percent escapes in git-svn URIs","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-03-21T06:51:30Z","receivedAt":"2008-03-21T06:51:30Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Kevin Ballard <kevin@sb.org> wrote:\n> git-svn: project names are percent-escaped ever since f5530b.\n> Unfortunately this breaks the scenario where the user hands git-svn\n> an already-escaped URI. Fix the regexp to skip over what looks like\n> existing percent escapes, and test this scenario.\n> \n> Signed-off-by: Kevin Ballard <kevin@sb.org>\n\nAcked-by: Eric Wong <normalperson@yhbt.net>\n\n> ---\n>  git-svn.perl                                  |    2 +-\n>  t/t9120-git-svn-clone-with-percent-escapes.sh |   31 +++++++++++++++++++++++++\n>  2 files changed, 32 insertions(+), 1 deletions(-)\n>  create mode 100755 t/t9120-git-svn-clone-with-percent-escapes.sh\n> \n> diff --git a/git-svn.perl b/git-svn.perl\n> index bba22c1..0c2b791 100755\n> --- a/git-svn.perl\n> +++ b/git-svn.perl\n> @@ -3665,7 +3665,7 @@ sub escape_uri_only {\n>  \tmy ($uri) = @_;\n>  \tmy @tmp;\n>  \tforeach (split m{/}, $uri) {\n> -\t\ts/([^\\w.-])/sprintf(\"%%%02X\",ord($1))/eg;\n> +\t\ts/([^\\w.%-]|%(?![a-fA-F0-9]{2}))/sprintf(\"%%%02X\",ord($1))/eg;\n>  \t\tpush @tmp, $_;\n>  \t}\n>  \tjoin('/', @tmp);\n> diff --git a/t/t9120-git-svn-clone-with-percent-escapes.sh b/t/t9120-git-svn-clone-with-percent-escapes.sh\n> new file mode 100755\n> index 0000000..9a4eabe\n> --- /dev/null\n> +++ b/t/t9120-git-svn-clone-with-percent-escapes.sh\n> @@ -0,0 +1,31 @@\n> +#!/bin/sh\n> +#\n> +# Copyright (c) 2008 Kevin Ballard\n> +#\n> +\n> +test_description='git-svn clone with percent escapes'\n> +. ./lib-git-svn.sh\n> +\n> +test_expect_success 'setup svnrepo' \"\n> +\tmkdir project project/trunk project/branches project/tags &&\n> +\techo foo > project/trunk/foo &&\n> +\tsvn import -m '$test_description' project '$svnrepo/pr ject' &&\n> +\trm -rf project &&\n> +\tstart_httpd\n> +\"\n> +\n> +if test \"$SVN_HTTPD_PORT\" = \"\"\n> +then\n> +\ttest_expect_failure 'test clone with percent escapes - needs SVN_HTTPD_PORT set' 'false'\n> +else\n> +\ttest_expect_success 'test clone with percent escapes' '\n> +\t\tgit svn clone \"$svnrepo/pr%20ject\" clone &&\n> +\t\tcd clone &&\n> +\t\t\tgit rev-parse refs/remotes/git-svn &&\n> +\t\tcd ..\n> +\t'\n> +fi\n> +\n> +stop_httpd\n> +\n> +test_done\n> -- \n> 1.5.5.rc0.10.g0fd43\n"},{"id":"72577","messageId":"7vtzj0r2k8.fsf@gitster.siamese.dyndns.org","threadId":"12781","inReplyTo":"20080321065130.GA28144@muzzle","subject":"Re: [PATCH resend 2/2] Don't try and percent-escape existing percent escapes in git-svn URIs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-03-21T06:52:55Z","receivedAt":"2008-03-21T06:52:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.\n"},{"id":"72578","messageId":"20080321065824.GB28144@muzzle","threadId":"12781","inReplyTo":"1206043729-61810-1-git-send-email-kevin@sb.org","subject":"Re: [PATCH resend 1/2] Make git-svn tests behave better on OS X","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-03-21T06:58:24Z","receivedAt":"2008-03-21T06:58:24Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Kevin Ballard <kevin@sb.org> wrote:\n> Give lib-git-svn.sh some better defaults for OS X.\n> Explicitly define the LockFile so httpd will actually start under OS X\n> \n> Signed-off-by: Kevin Ballard <kevin@sb.org>\n\nThanks,\n\nAcked-by: Eric Wong <normalperson@yhbt.net>\n\nI seem to recall seeing a RHEL or CentOS machine using /usr/sbin/httpd,\nsomewhere, too.  Any non-Debian users care to comment/add more paths?\n\n> ---\n>  t/lib-git-svn.sh |   11 +++++++++--\n>  1 files changed, 9 insertions(+), 2 deletions(-)\n> \n> diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh\n> index 9ee35e7..1266609 100644\n> --- a/t/lib-git-svn.sh\n> +++ b/t/lib-git-svn.sh\n> @@ -49,8 +49,14 @@ 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> +if test `uname -s` = Darwin\n> +then\n> +\tSVN_HTTPD_MODULE_PATH=${SVN_HTTPD_MODULE_PATH-'/usr/libexec/apache2'}\n> +\tSVN_HTTPD_PATH=${SVN_HTTPD_PATH-'/usr/sbin/httpd'}\n> +else\n> +\tSVN_HTTPD_MODULE_PATH=${SVN_HTTPD_MODULE_PATH-'/usr/lib/apache2/modules'}\n> +\tSVN_HTTPD_PATH=${SVN_HTTPD_PATH-'/usr/sbin/apache2'}\n> +fi\n>  \n>  start_httpd () {\n>  \tif test -z \"$SVN_HTTPD_PORT\"\n> @@ -66,6 +72,7 @@ ServerName \"git-svn test\"\n>  ServerRoot \"$GIT_DIR\"\n>  DocumentRoot \"$GIT_DIR\"\n>  PidFile \"$GIT_DIR/httpd.pid\"\n> +LockFile logs/accept.lock\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> -- \n"},{"id":"72580","messageId":"7vod98r210.fsf@gitster.siamese.dyndns.org","threadId":"12781","inReplyTo":"20080321065824.GB28144@muzzle","subject":"Re: [PATCH resend 1/2] Make git-svn tests behave better on OS X","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-03-21T07:04:27Z","receivedAt":"2008-03-21T07:04:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Wong <normalperson@yhbt.net> writes:\n\n> Kevin Ballard <kevin@sb.org> wrote:\n> ...\n> I seem to recall seeing a RHEL or CentOS machine using /usr/sbin/httpd,\n> somewhere, too.  Any non-Debian users care to comment/add more paths?\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>> +if test `uname -s` = Darwin\n>> +then\n>> +\tSVN_HTTPD_MODULE_PATH=${SVN_HTTPD_MODULE_PATH-'/usr/libexec/apache2'}\n>> +\tSVN_HTTPD_PATH=${SVN_HTTPD_PATH-'/usr/sbin/httpd'}\n>> +else\n>> +\tSVN_HTTPD_MODULE_PATH=${SVN_HTTPD_MODULE_PATH-'/usr/lib/apache2/modules'}\n>> +\tSVN_HTTPD_PATH=${SVN_HTTPD_PATH-'/usr/sbin/apache2'}\n>> +fi\n\nI really hate this patch.\n\nWhy do we even _care_ about uname?\n\nWouldn't something like this be a lot easier to maintain in the longer run?\n\n    for d in \\\n            \"$SVN_HTTPD_MODULE_PATH\" \\\n            /usr/lib/apache2/modules \\\n            /usr/libexec/apache2 \\\n    ; do\n            if test -d \"$d\"\n            then\n                    SVN_HTTPD_MODULE_PATH=\"$d\"\n                    break\n            fi\n    done\n"},{"id":"299040","messageId":"1206084455-2793-1-git-send-email-kevin@sb.org","threadId":"12781","inReplyTo":"7vod98r210.fsf@gitster.siamese.dyndns.org","subject":"[PATCH] Make git-svn tests behave better on OS X","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2008-03-21T07:27:35Z","receivedAt":"2008-03-21T07:27:35Z","isPatch":true,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"This patch works fine for me.\n\n-->8--\n\nGive lib-git-svn.sh a few alternate paths to look for apache2.\nExplicitly define the LockFile so httpd will actually start under OS X\n\nSigned-off-by: Kevin Ballard <kevin@sb.org>\n---\n t/lib-git-svn.sh |   25 +++++++++++++++++++++++--\n 1 files changed, 23 insertions(+), 2 deletions(-)\n\ndiff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh\nindex 9ee35e7..9decd2e 100644\n--- a/t/lib-git-svn.sh\n+++ b/t/lib-git-svn.sh\n@@ -49,8 +49,28 @@ 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+for d in \\\n+\t\"$SVN_HTTPD_PATH\" \\\n+\t/usr/sbin/apache2 \\\n+\t/usr/sbin/httpd \\\n+; do\n+\tif test -f \"$d\"\n+\tthen\n+\t\tSVN_HTTPD_PATH=\"$d\"\n+\t\tbreak\n+\tfi\n+done\n+for d in \\\n+\t\"$SVN_HTTPD_MODULE_PATH\" \\\n+\t/usr/lib/apache2/modules \\\n+\t/usr/libexec/apache2 \\\n+; do\n+\tif test -d \"$d\"\n+\tthen\n+\t\tSVN_HTTPD_MODULE_PATH=\"$d\"\n+\t\tbreak\n+\tfi\n+done\n \n start_httpd () {\n \tif test -z \"$SVN_HTTPD_PORT\"\n@@ -66,6 +86,7 @@ ServerName \"git-svn test\"\n ServerRoot \"$GIT_DIR\"\n DocumentRoot \"$GIT_DIR\"\n PidFile \"$GIT_DIR/httpd.pid\"\n+LockFile logs/accept.lock\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-- \n1.5.5.rc0.23.gf91eb\n\n"},{"id":"72694","messageId":"20080322193518.GA32019@soma","threadId":"12781","inReplyTo":"1206084455-2793-1-git-send-email-kevin@sb.org","subject":"Re: [PATCH] Make git-svn tests behave better on OS X","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-03-22T19:35:18Z","receivedAt":"2008-03-22T19:35:18Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Kevin Ballard <kevin@sb.org> wrote:\n> This patch works fine for me.\n> \n> -->8--\n> \n> Give lib-git-svn.sh a few alternate paths to look for apache2.\n> Explicitly define the LockFile so httpd will actually start under OS X\n> \n> Signed-off-by: Kevin Ballard <kevin@sb.org>\n\nAcked-by: Eric Wong <normalperson@yhbt.net>\n\n> ---\n>  t/lib-git-svn.sh |   25 +++++++++++++++++++++++--\n>  1 files changed, 23 insertions(+), 2 deletions(-)\n> \n> diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh\n> index 9ee35e7..9decd2e 100644\n> --- a/t/lib-git-svn.sh\n> +++ b/t/lib-git-svn.sh\n> @@ -49,8 +49,28 @@ 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> +for d in \\\n> +\t\"$SVN_HTTPD_PATH\" \\\n> +\t/usr/sbin/apache2 \\\n> +\t/usr/sbin/httpd \\\n> +; do\n> +\tif test -f \"$d\"\n> +\tthen\n> +\t\tSVN_HTTPD_PATH=\"$d\"\n> +\t\tbreak\n> +\tfi\n> +done\n> +for d in \\\n> +\t\"$SVN_HTTPD_MODULE_PATH\" \\\n> +\t/usr/lib/apache2/modules \\\n> +\t/usr/libexec/apache2 \\\n> +; do\n> +\tif test -d \"$d\"\n> +\tthen\n> +\t\tSVN_HTTPD_MODULE_PATH=\"$d\"\n> +\t\tbreak\n> +\tfi\n> +done\n>  \n>  start_httpd () {\n>  \tif test -z \"$SVN_HTTPD_PORT\"\n> @@ -66,6 +86,7 @@ ServerName \"git-svn test\"\n>  ServerRoot \"$GIT_DIR\"\n>  DocumentRoot \"$GIT_DIR\"\n>  PidFile \"$GIT_DIR/httpd.pid\"\n> +LockFile logs/accept.lock\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> -- \n> 1.5.5.rc0.23.gf91eb\n"}]}