{"thread":{"id":"14312","subject":"[PATCH/rfc] git-svn.perl: workaround assertions in svn library 1.5.0","startedAt":"2008-07-06T19:28:50Z","lastAt":"2008-07-21T01:54:12Z","messageCount":8,"participants":["Gerrit Pape","Eric Wong","Dmitry Potapov","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"82384","messageId":"20080706192850.32547.qmail@4480698c45f1ed.315fe32.mid.smarden.org","threadId":"14312","inReplyTo":null,"subject":"[PATCH/rfc] git-svn.perl: workaround assertions in svn library 1.5.0","fromName":"Gerrit Pape","fromEmail":"pape@smarden.org","sentAt":"2008-07-06T19:28:50Z","receivedAt":"2008-07-06T19:28:50Z","isPatch":true,"sender":{"key":"pape@smarden.org","avatar":"https://avatars.githubusercontent.com/u/143170252?v=4"},"body":"With subversion 1.5.0 (C and perl libraries) the git-svn selftest\nt9101-git-svn-props.sh fails at test 25 and 26.  The following commands\ncause assertions in the svn library\n\n $ cd deeply\n $ git-svn propget svn:ignore .\n perl: /build/buildd/subversion-1.5.0dfsg1/subversion/libsvn_ra/ra_loader.c:674: svn_ra_get_dir: Assertion `*path != '/'' failed.\n Aborted\n\n $ git-svn propget svn:ignore ..\n perl: /build/buildd/subversion-1.5.0dfsg1/subversion/libsvn_subr/path.c:120: svn_path_join: Assertion `is_canonical(component, clen)' failed.\n\nWith this commit, git-svn makes sure the path doesn't start with a\nslash, and is not a dot, working around these assertions.\n\nThe breakage was reported by Lucas Nussbaum through\n http://bugs.debian.org/489108\n\nSigned-off-by: Gerrit Pape <pape@smarden.org>\n---\n git-svn.perl |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\nI ran into this on Debian/unstable.  With svn 1.5.0 the selftest fails\nwithout the patch, with svn 1.4.6 it succeeds with and without the\npatch.  I'm not familar with the svn interfaces, not sure whether this\nis a regression in subversion, or a bug in git-svn.\n\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex f789a6e..a366c89 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -643,6 +643,8 @@ sub canonicalize_path {\n \t$path =~ s#/[^/]+/\\.\\.##g;\n \t$path =~ s#/$##g;\n \t$path =~ s#^\\./## if $dot_slash_added;\n+\t$path =~ s#^/##;\n+\t$path =~ s#^\\.$##;\n \treturn $path;\n }\n \n-- \n1.5.6\n"},{"id":"82433","messageId":"20080707090605.GA20731@untitled","threadId":"14312","inReplyTo":"20080706192850.32547.qmail@4480698c45f1ed.315fe32.mid.smarden.org","subject":"Re: [PATCH/rfc] git-svn.perl: workaround assertions in svn library 1.5.0","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-07-07T09:06:05Z","receivedAt":"2008-07-07T09:06:05Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Gerrit Pape <pape@smarden.org> wrote:\n> With subversion 1.5.0 (C and perl libraries) the git-svn selftest\n> t9101-git-svn-props.sh fails at test 25 and 26.  The following commands\n> cause assertions in the svn library\n> \n>  $ cd deeply\n>  $ git-svn propget svn:ignore .\n>  perl: /build/buildd/subversion-1.5.0dfsg1/subversion/libsvn_ra/ra_loader.c:674: svn_ra_get_dir: Assertion `*path != '/'' failed.\n>  Aborted\n> \n>  $ git-svn propget svn:ignore ..\n>  perl: /build/buildd/subversion-1.5.0dfsg1/subversion/libsvn_subr/path.c:120: svn_path_join: Assertion `is_canonical(component, clen)' failed.\n> \n> With this commit, git-svn makes sure the path doesn't start with a\n> slash, and is not a dot, working around these assertions.\n> \n> The breakage was reported by Lucas Nussbaum through\n>  http://bugs.debian.org/489108\n> \n> Signed-off-by: Gerrit Pape <pape@smarden.org>\n\nThanks Gerrit,\n\nThis works with svn 1.4.3 here\n\nAcked-by: Eric Wong <normalperson@yhbt.net>\n\n> ---\n>  git-svn.perl |    2 ++\n>  1 files changed, 2 insertions(+), 0 deletions(-)\n> \n> I ran into this on Debian/unstable.  With svn 1.5.0 the selftest fails\n> without the patch, with svn 1.4.6 it succeeds with and without the\n> patch.  I'm not familar with the svn interfaces, not sure whether this\n> is a regression in subversion, or a bug in git-svn.\n> \n> \n> diff --git a/git-svn.perl b/git-svn.perl\n> index f789a6e..a366c89 100755\n> --- a/git-svn.perl\n> +++ b/git-svn.perl\n> @@ -643,6 +643,8 @@ sub canonicalize_path {\n>  \t$path =~ s#/[^/]+/\\.\\.##g;\n>  \t$path =~ s#/$##g;\n>  \t$path =~ s#^\\./## if $dot_slash_added;\n> +\t$path =~ s#^/##;\n> +\t$path =~ s#^\\.$##;\n>  \treturn $path;\n>  }\n>  \n> -- \n> 1.5.6\n"},{"id":"83691","messageId":"20080717140856.10213.qmail@c0f13986110104.315fe32.mid.smarden.org","threadId":"14312","inReplyTo":"20080706192850.32547.qmail@4480698c45f1ed.315fe32.mid.smarden.org","subject":"Re: [PATCH/rfc] git-svn.perl: workaround assertions in svn library 1.5.0","fromName":"Gerrit Pape","fromEmail":"pape@smarden.org","sentAt":"2008-07-17T14:08:56Z","receivedAt":"2008-07-17T14:08:56Z","isPatch":true,"sender":{"key":"pape@smarden.org","avatar":"https://avatars.githubusercontent.com/u/143170252?v=4"},"body":"On Sun, Jul 06, 2008 at 07:28:50PM +0000, Gerrit Pape wrote:\n> With subversion 1.5.0 (C and perl libraries) the git-svn selftest\n> t9101-git-svn-props.sh fails at test 25 and 26.  The following commands\n\n> The breakage was reported by Lucas Nussbaum through\n>  http://bugs.debian.org/489108\n\n> ---\n>  git-svn.perl |    2 ++\n>  1 files changed, 2 insertions(+), 0 deletions(-)\n> \n> I ran into this on Debian/unstable.  With svn 1.5.0 the selftest fails\n> without the patch, with svn 1.4.6 it succeeds with and without the\n> patch.  I'm not familar with the svn interfaces, not sure whether this\n> is a regression in subversion, or a bug in git-svn.\n\nHi, while this commit fixed the selftests, it unfortunately is a\nregression\n\n http://thread.gmane.org/gmane.comp.version-control.git/87822/\n http://bugs.debian.org/490400\n\nI'm still not sure whether this is a git-svn problem, or actually a\nproblem in subversion 1.5.0\n\n $ perl -MSVN::Client -e \\\n 'sub print_names { print \"<$_[0]>\\n\"; } $ctx=new SVN::Client;\n $ctx->status(\".\", \"BASE\", \\&print_names, 1, 1, 0, 1);' | head -5\n perl:\n /build/buildd/subversion-1.5.0dfsg1/subversion/libsvn_subr/path.c:119: svn_path_join: Assertion `is_canonical(base, blen)' failed.\n $ \n [0]\n\nRegards, Gerrit.\n\n[0] http://bugs.debian.org/359679\n"},{"id":"83736","messageId":"37fcd2780807171137m1c5a8197vc94b2a42ac53a297@mail.gmail.com","threadId":"14312","inReplyTo":"20080717140856.10213.qmail@c0f13986110104.315fe32.mid.smarden.org","subject":"Re: [PATCH/rfc] git-svn.perl: workaround assertions in svn library 1.5.0","fromName":"Dmitry Potapov","fromEmail":"dpotapov@gmail.com","sentAt":"2008-07-17T18:37:48Z","receivedAt":"2008-07-17T18:37:48Z","isPatch":true,"sender":{"key":"dpotapov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6568595?v=4"},"body":"On Thu, Jul 17, 2008 at 6:08 PM, Gerrit Pape <pape@smarden.org> wrote:\n>\n> Hi, while this commit fixed the selftests, it unfortunately is a\n> regression\n>\n>  http://thread.gmane.org/gmane.comp.version-control.git/87822/\n>  http://bugs.debian.org/490400\n\nThis particular breakage is easy to fix:\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 3750e47..a5a5b1b 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -1226,7 +1226,7 @@ sub linearize_history {\n\n sub find_file_type_and_diff_status {\n        my ($path) = @_;\n-       return ('dir', '') if $path eq '.';\n+       return ('dir', '') if $path eq '';\n\n        my $diff_output =\n            command_oneline(qw(diff --cached --name-status --), $path) || \"\";\n\nbut it could be some other places in git-svn that may need correction too.\n\n>\n> I'm still not sure whether this is a git-svn problem, or actually a\n> problem in subversion 1.5.0\n\nAccordingly to SVN developers you do not use SVN API correctly,\ntherefore you got assert. So, the problem in git-svn.\nhttp://svn.haxx.se/dev/archive-2008-01/0425.shtml\n\nDmitry\n"},{"id":"83985","messageId":"7vbq0tibuf.fsf@gitster.siamese.dyndns.org","threadId":"14312","inReplyTo":"37fcd2780807171137m1c5a8197vc94b2a42ac53a297@mail.gmail.com","subject":"Re: [PATCH/rfc] git-svn.perl: workaround assertions in svn library 1.5.0","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-20T01:27:36Z","receivedAt":"2008-07-20T01:27:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Dmitry Potapov\" <dpotapov@gmail.com> writes:\n\n> On Thu, Jul 17, 2008 at 6:08 PM, Gerrit Pape <pape@smarden.org> wrote:\n>>\n>> Hi, while this commit fixed the selftests, it unfortunately is a\n>> regression\n>>\n>>  http://thread.gmane.org/gmane.comp.version-control.git/87822/\n>>  http://bugs.debian.org/490400\n>\n> This particular breakage is easy to fix:\n>\n> diff --git a/git-svn.perl b/git-svn.perl\n> index 3750e47..a5a5b1b 100755\n> --- a/git-svn.perl\n> +++ b/git-svn.perl\n> @@ -1226,7 +1226,7 @@ sub linearize_history {\n>\n>  sub find_file_type_and_diff_status {\n>         my ($path) = @_;\n> -       return ('dir', '') if $path eq '.';\n> +       return ('dir', '') if $path eq '';\n>\n>         my $diff_output =\n>             command_oneline(qw(diff --cached --name-status --), $path) || \"\";\n>\n> but it could be some other places in git-svn that may need correction too.\n>\n>>\n>> I'm still not sure whether this is a git-svn problem, or actually a\n>> problem in subversion 1.5.0\n>\n> Accordingly to SVN developers you do not use SVN API correctly,\n> therefore you got assert. So, the problem in git-svn.\n> http://svn.haxx.se/dev/archive-2008-01/0425.shtml\n\nSo what's the conclusion of this issue?\n\nI'll just revert 2fe403e (git-svn.perl: workaround assertions in svn\nlibrary 1.5.0, 2008-07-06) for 1.6.0-rc0 unless I hear better\nsuggestions.\n"},{"id":"84059","messageId":"20080720201407.GM2925@dpotapov.dyndns.org","threadId":"14312","inReplyTo":"7vbq0tibuf.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH/rfc] git-svn.perl: workaround assertions in svn library 1.5.0","fromName":"Dmitry Potapov","fromEmail":"dpotapov@gmail.com","sentAt":"2008-07-20T20:14:07Z","receivedAt":"2008-07-20T20:14:07Z","isPatch":true,"sender":{"key":"dpotapov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6568595?v=4"},"body":"On Sat, Jul 19, 2008 at 06:27:36PM -0700, Junio C Hamano wrote:\n> \n> So what's the conclusion of this issue?\n> \n> I'll just revert 2fe403e (git-svn.perl: workaround assertions in svn\n> library 1.5.0, 2008-07-06) for 1.6.0-rc0 unless I hear better\n> suggestions.\n\nI have tested the change that I proposed, and it seems to solve the\nproblem and, as far as I can tell, no other correction is necessary.\nYet, I don't really understand git-svn well, so I could be wrong.\n\nReverting 2fe403e will only help users of svn library 1.4, while all\nnew linux distributives, which will include Git 1.6.0, are going to\ninstall svn library 1.5.0, and if you use svn library 1.5.0, reverting\n2fe403e does not fix anything but only add one more bug. Thus, unless\nwe are going to require to install git-svn only with svn library 1.4,\nreverting this change does not seem to be very helpful for most users.\n\nSo, I hope my patch is better solution...\n\nDmitry\n\n-- 8< --\nFrom: Dmitry Potapov <dpotapov@gmail.com>\nDate: Thu, 17 Jul 2008 22:32:02 +0400\nSubject: [PATCH] git-svn: fix git svn info to work without arguments\n\ncommit 2fe403e7452bd6e1e8232445cf5434ce8f1af973 broke \"git-svn info .\"\ndue to replacing '.' with '' in canonicalize_path for the top directory,\nwhile find_file_type_and_diff_status was not corrected.\n\nBug reports:\n\nhttp://thread.gmane.org/gmane.comp.version-control.git/87822/\nhttp://bugs.debian.org/490400\n\nSigned-off-by: Dmitry Potapov <dpotapov@gmail.com>\n---\n git-svn.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex a366c89..b00a91a 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -1226,7 +1226,7 @@ sub linearize_history {\n \n sub find_file_type_and_diff_status {\n \tmy ($path) = @_;\n-\treturn ('dir', '') if $path eq '.';\n+\treturn ('dir', '') if $path eq '';\n \n \tmy $diff_output =\n \t    command_oneline(qw(diff --cached --name-status --), $path) || \"\";\n-- \n1.5.6.3\n"},{"id":"84127","messageId":"20080721012955.GA14129@untitled","threadId":"14312","inReplyTo":"20080720201407.GM2925@dpotapov.dyndns.org","subject":"Re: [PATCH/rfc] git-svn.perl: workaround assertions in svn library 1.5.0","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-07-21T01:29:55Z","receivedAt":"2008-07-21T01:29:55Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Dmitry Potapov <dpotapov@gmail.com> wrote:\n> On Sat, Jul 19, 2008 at 06:27:36PM -0700, Junio C Hamano wrote:\n> > \n> > So what's the conclusion of this issue?\n> > \n> > I'll just revert 2fe403e (git-svn.perl: workaround assertions in svn\n> > library 1.5.0, 2008-07-06) for 1.6.0-rc0 unless I hear better\n> > suggestions.\n> \n> I have tested the change that I proposed, and it seems to solve the\n> problem and, as far as I can tell, no other correction is necessary.\n> Yet, I don't really understand git-svn well, so I could be wrong.\n> \n> Reverting 2fe403e will only help users of svn library 1.4, while all\n> new linux distributives, which will include Git 1.6.0, are going to\n> install svn library 1.5.0, and if you use svn library 1.5.0, reverting\n> 2fe403e does not fix anything but only add one more bug. Thus, unless\n> we are going to require to install git-svn only with svn library 1.4,\n> reverting this change does not seem to be very helpful for most users.\n> \n> So, I hope my patch is better solution...\n> \n> Dmitry\n\nThanks Dmitry,\n\nYour patch works for me on 1.4.3, so if it works with\n1.5.0, consider it: Acked-by: Eric Wong <normalperson@yhbt.net>\n\n-- \nEric Wong\n"},{"id":"84130","messageId":"7vvdz0ypbv.fsf@gitster.siamese.dyndns.org","threadId":"14312","inReplyTo":"20080721012955.GA14129@untitled","subject":"Re: [PATCH/rfc] git-svn.perl: workaround assertions in svn library 1.5.0","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-07-21T01:54:12Z","receivedAt":"2008-07-21T01:54:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks, both.\n"}]}