* A bug with "git svn show-externals"
@ 2016-10-25 23:53 Tao Peng
2016-10-26 19:10 ` Eric Wong
0 siblings, 1 reply; 2+ messages in thread
From: Tao Peng @ 2016-10-25 23:53 UTC (permalink / raw)
To: git
Hi there,
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.
Example:
$ svn pg svn:externals svn+ssh://src.foo.com/svn/ref/English.lproj/
svn+ssh://src.foo.com/svn/orig/trunk/Resources/English.lproj/Localizable.strings Localizable.strings
$ git svn show-externals
# /English.lproj/
/English.lproj/svn+ssh://src.foo.com/svn/orig/trunk/Resources/English.lproj/Localizable.strings Localizable.strings
This bug is preventing my script from correctly finishing the svn-to-git repo migration work. Does anyone know a workaround to this bug?
Thanks,
Peng
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: A bug with "git svn show-externals"
2016-10-25 23:53 A bug with "git svn show-externals" Tao Peng
@ 2016-10-26 19:10 ` Eric Wong
0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2016-10-26 19:10 UTC (permalink / raw)
To: Tao Peng; +Cc: git, Vineet Kumar
Tao Peng <pengtao@me.com> wrote:
> Hi there,
>
> 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.
>
> Example:
> $ svn pg svn:externals svn+ssh://src.foo.com/svn/ref/English.lproj/
> svn+ssh://src.foo.com/svn/orig/trunk/Resources/English.lproj/Localizable.strings Localizable.strings
+Cc Vineet who originally implemented this 9 years ago
I've never used externals much, but I guess it's common for
externals to be a full URL and not merely a relative path
to somewhere within the same SVN repo.
> $ git svn show-externals
> # /English.lproj/
> /English.lproj/svn+ssh://src.foo.com/svn/orig/trunk/Resources/English.lproj/Localizable.strings Localizable.strings
>
> This bug is preventing my script from correctly finishing the svn-to-git repo migration work. Does anyone know a workaround to this bug?
Can you try the following change to ignore path prefixing for
full URLs?
diff --git a/git-svn.perl b/git-svn.perl
index 4d41d22..ced665a 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1303,7 +1303,9 @@ sub cmd_show_externals {
my $s = $props->{'svn:externals'} or return;
$s =~ s/[\r\n]+/\n/g;
chomp $s;
- $s =~ s#^#$path#gm;
+ if ($s !~ m#^[a-z\+]+://#i) {
+ $s =~ s#^#$path#gm;
+ }
print STDOUT "$s\n";
});
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-26 19:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-25 23:53 A bug with "git svn show-externals" Tao Peng
2016-10-26 19:10 ` Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).