git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: Tao Peng <pengtao@me.com>
Cc: git@vger.kernel.org, Vineet Kumar <vineet@doorstop.net>
Subject: Re: A bug with "git svn show-externals"
Date: Wed, 26 Oct 2016 19:10:23 +0000	[thread overview]
Message-ID: <20161026191023.GA24666@starla> (raw)
In-Reply-To: <B8D25850-A4DE-435C-A856-240D612D59DA@me.com>

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";
 	});
 }

      reply	other threads:[~2016-10-26 19:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-25 23:53 A bug with "git svn show-externals" Tao Peng
2016-10-26 19:10 ` Eric Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161026191023.GA24666@starla \
    --to=e@80x24.org \
    --cc=git@vger.kernel.org \
    --cc=pengtao@me.com \
    --cc=vineet@doorstop.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).