{"thread":{"id":"11550","subject":"[PATCH] Trim leading / off of paths in git-svn prop_walk","startedAt":"2008-01-09T06:37:20Z","lastAt":"2008-01-09T22:55:32Z","messageCount":3,"participants":["Kevin Ballard","Junio C Hamano","Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"64817","messageId":"1199860640-74118-1-git-send-email-kevin@sb.org","threadId":"11550","inReplyTo":null,"subject":"[PATCH] Trim leading / off of paths in git-svn prop_walk","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2008-01-09T06:37:20Z","receivedAt":"2008-01-09T06:37:20Z","isPatch":true,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"prop_walk adds a leading / to all subdirectory paths. Unfortunately\nthis causes a problem when the remote repo lives in a subdirectory itself,\nas the leading / causes subsequent PROPFIND calls to be executed on\nthe wrong path. Trimming the / before calling the PROPFIND fixes this problem.\n\nSigned-off-by: Kevin Ballard <kevin@sb.org>\n---\nAll tests passed after this change, but since it seems to only apply\nto WebDAV SVN repos I saw no way to add a new test.\n git-svn.perl |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 3308fe1..d5316eb 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -1858,6 +1858,7 @@ sub rel_path {\n sub prop_walk {\n \tmy ($self, $path, $rev, $sub) = @_;\n \n+\t$path =~ s#^/##;\n \tmy ($dirent, undef, $props) = $self->ra->get_dir($path, $rev);\n \t$path =~ s#^/*#/#g;\n \tmy $p = $path;\n-- \n1.5.4.rc2.68.ge708a-dirty\n"},{"id":"64873","messageId":"7v63y2hg8x.fsf@gitster.siamese.dyndns.org","threadId":"11550","inReplyTo":"1199860640-74118-1-git-send-email-kevin@sb.org","subject":"Re: [PATCH] Trim leading / off of paths in git-svn prop_walk","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-09T20:54:22Z","receivedAt":"2008-01-09T20:54:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kevin Ballard <kevin@sb.org> writes:\n\n> prop_walk adds a leading / to all subdirectory paths. Unfortunately\n> this causes a problem when the remote repo lives in a subdirectory itself,\n> as the leading / causes subsequent PROPFIND calls to be executed on\n> the wrong path. Trimming the / before calling the PROPFIND fixes this problem.\n>\n> Signed-off-by: Kevin Ballard <kevin@sb.org>\n\nEric, the change is very limited in scope (only the parameter to\nra->get_dir() changes) so I can apply myself, if you agree this\nis a trivially correct fix.  I just do not know svn-perl\ninterface well enough to judge.\n\n> All tests passed after this change, but since it seems to only apply\n> to WebDAV SVN repos I saw no way to add a new test.\n>  git-svn.perl |    1 +\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n>\n> diff --git a/git-svn.perl b/git-svn.perl\n> index 3308fe1..d5316eb 100755\n> --- a/git-svn.perl\n> +++ b/git-svn.perl\n> @@ -1858,6 +1858,7 @@ sub rel_path {\n>  sub prop_walk {\n>  \tmy ($self, $path, $rev, $sub) = @_;\n>  \n> +\t$path =~ s#^/##;\n>  \tmy ($dirent, undef, $props) = $self->ra->get_dir($path, $rev);\n>  \t$path =~ s#^/*#/#g;\n>  \tmy $p = $path;\n> -- \n> 1.5.4.rc2.68.ge708a-dirty\n"},{"id":"64881","messageId":"20080109225532.GA31363@untitled","threadId":"11550","inReplyTo":"7v63y2hg8x.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Trim leading / off of paths in git-svn prop_walk","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-01-09T22:55:32Z","receivedAt":"2008-01-09T22:55:32Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Junio C Hamano <gitster@pobox.com> wrote:\n> Kevin Ballard <kevin@sb.org> writes:\n> \n> > prop_walk adds a leading / to all subdirectory paths. Unfortunately\n> > this causes a problem when the remote repo lives in a subdirectory itself,\n> > as the leading / causes subsequent PROPFIND calls to be executed on\n> > the wrong path. Trimming the / before calling the PROPFIND fixes this problem.\n> >\n> > Signed-off-by: Kevin Ballard <kevin@sb.org>\n> \n> Eric, the change is very limited in scope (only the parameter to\n> ra->get_dir() changes) so I can apply myself, if you agree this\n> is a trivially correct fix.  I just do not know svn-perl\n> interface well enough to judge.\n\nYes it is.  It appears this regression was introduced in\n01bdab84e31763a98206c31cf99b9dc3cb221356 so yes, it's trivially\ncorrect :)\n\nAcked-by: Eric Wong <normalperson@yhbt.net>\n\n> \n> > All tests passed after this change, but since it seems to only apply\n> > to WebDAV SVN repos I saw no way to add a new test.\n> >  git-svn.perl |    1 +\n> >  1 files changed, 1 insertions(+), 0 deletions(-)\n> >\n> > diff --git a/git-svn.perl b/git-svn.perl\n> > index 3308fe1..d5316eb 100755\n> > --- a/git-svn.perl\n> > +++ b/git-svn.perl\n> > @@ -1858,6 +1858,7 @@ sub rel_path {\n> >  sub prop_walk {\n> >  \tmy ($self, $path, $rev, $sub) = @_;\n> >  \n> > +\t$path =~ s#^/##;\n> >  \tmy ($dirent, undef, $props) = $self->ra->get_dir($path, $rev);\n> >  \t$path =~ s#^/*#/#g;\n> >  \tmy $p = $path;\n> > -- \n> > 1.5.4.rc2.68.ge708a-dirty\n\n-- \nEric Wong\n"}]}