{"thread":{"id":"44374","subject":"A bug with \"git svn show-externals\"","startedAt":"2016-10-26T00:53:24Z","lastAt":"2016-10-26T19:10:28Z","messageCount":2,"participants":["Tao Peng","Eric Wong"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"304878","messageId":"B8D25850-A4DE-435C-A856-240D612D59DA@me.com","threadId":"44374","inReplyTo":null,"subject":"A bug with \"git svn show-externals\"","fromName":"Tao Peng","fromEmail":"pengtao@me.com","sentAt":"2016-10-25T23:53:17Z","receivedAt":"2016-10-26T00:53:24Z","isPatch":false,"sender":{"key":"pengtao@me.com","avatar":null},"body":"Hi there,\n\nI met a bug of the \"git svn show-externals” command.  If a subdirectory item has a svn:externals property, and the format of the property is “URL first, then the local path”, running \"git svn show-externals” command at the root level will result in an unusable output.\n\nExample:\n$ svn pg svn:externals svn+ssh://src.foo.com/svn/ref/English.lproj/\nsvn+ssh://src.foo.com/svn/orig/trunk/Resources/English.lproj/Localizable.strings Localizable.strings\n\n$ git svn show-externals\n# /English.lproj/\n/English.lproj/svn+ssh://src.foo.com/svn/orig/trunk/Resources/English.lproj/Localizable.strings Localizable.strings\n\n\nThis bug is preventing my script from correctly finishing the svn-to-git repo migration work. Does anyone know a workaround to this bug?\n\nThanks,\nPeng"},{"id":"304906","messageId":"20161026191023.GA24666@starla","threadId":"44374","inReplyTo":"B8D25850-A4DE-435C-A856-240D612D59DA@me.com","subject":"Re: A bug with \"git svn show-externals\"","fromName":"Eric Wong","fromEmail":"e@80x24.org","sentAt":"2016-10-26T19:10:23Z","receivedAt":"2016-10-26T19:10:28Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Tao Peng <pengtao@me.com> wrote:\n> Hi there,\n> \n> I met a bug of the \"git svn show-externals” command.  If a subdirectory item has a svn:externals property, and the format of the property is “URL first, then the local path”, running \"git svn show-externals” command at the root level will result in an unusable output.\n> \n> Example:\n> $ svn pg svn:externals svn+ssh://src.foo.com/svn/ref/English.lproj/\n> svn+ssh://src.foo.com/svn/orig/trunk/Resources/English.lproj/Localizable.strings Localizable.strings\n\n+Cc Vineet who originally implemented this 9 years ago\n\nI've never used externals much, but I guess it's common for\nexternals to be a full URL and not merely a relative path\nto somewhere within the same SVN repo.\n\n> $ git svn show-externals\n> # /English.lproj/\n> /English.lproj/svn+ssh://src.foo.com/svn/orig/trunk/Resources/English.lproj/Localizable.strings Localizable.strings\n\n> \n> This bug is preventing my script from correctly finishing the svn-to-git repo migration work. Does anyone know a workaround to this bug?\n\nCan you try the following change to ignore path prefixing for\nfull URLs?\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 4d41d22..ced665a 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -1303,7 +1303,9 @@ sub cmd_show_externals {\n \t\tmy $s = $props->{'svn:externals'} or return;\n \t\t$s =~ s/[\\r\\n]+/\\n/g;\n \t\tchomp $s;\n-\t\t$s =~ s#^#$path#gm;\n+\t\tif ($s !~ m#^[a-z\\+]+://#i) {\n+\t\t\t$s =~ s#^#$path#gm;\n+\t\t}\n \t\tprint STDOUT \"$s\\n\";\n \t});\n }\n"}]}