nirvdrum / svn2git

Ruby tool for importing existing svn projects into git.
MIT License
2.11k stars 443 forks source link

git svn fetch failed (on svn tagging commit) #99

Open przemoc opened 11 years ago

przemoc commented 11 years ago

I'm trying to rebase my vapoursynth svn2git repo (that was initiated with svn2git -v --revision 2 http://vapoursynth.googlecode.com/svn/ command some time ago), but git svn fetch is failing on the svn commit performing tagging. (Same thing happens if you want to run svn2git from scratch.)

$ svn2git --rebase --verbose
Running command: git status --porcelain --untracked-files=no
Running command: git branch -l --no-color
* master
Running command: git branch -r --no-color
  repo.or.cz/master
  svn/trunk
Running command: git svn fetch
Found possible branch point: http://vapoursynth.googlecode.com/svn/trunk => http://vapoursynth.googlecode.com/svn/tags/R15, 331
Use of uninitialized value $u in substitution (s///) at /usr/share/perl5/Git/SVN.pm line 106.
Use of uninitialized value $u in concatenation (.) or string at /usr/share/perl5/Git/SVN.pm line 106.
refs/remotes/svn/trunk: 'http://vapoursynth.googlecode.com/svn' not found in ''

command failed:
2>&1 git svn fetch

I upgraded to git 1.8.0 (from debian unstable repository), but it didn't help.

The referenced part of SVN.pm is below

 89 sub resolve_local_globs {
 90         my ($url, $fetch, $glob_spec) = @_;
 91         return unless defined $glob_spec;
 92         my $ref = $glob_spec->{ref};
 93         my $path = $glob_spec->{path};
 94         foreach (command(qw#for-each-ref --format=%(refname) refs/#)) {
 95                 next unless m#^$ref->{regex}$#;
 96                 my $p = $1;
 97                 my $pathname = desanitize_refname($path->full_path($p));
 98                 my $refname = desanitize_refname($ref->full_path($p));
 99                 if (my $existing = $fetch->{$pathname}) {
100                         if ($existing ne $refname) {
101                                 die "Refspec conflict:\n",
102                                     "existing: $existing\n",
103                                     " globbed: $refname\n";
104                         }
105                         my $u = (::cmt_metadata("$refname"))[0];
106                         $u =~ s!^\Q$url\E(/|$)!! or die
107                           "$refname: '$url' not found in '$u'\n";
108                         if ($pathname ne $u) {
109                                 warn "W: Refspec glob conflict ",
110                                      "(ref: $refname):\n",
111                                      "expected path: $pathname\n",
112                                      "    real path: $u\n",
113                                      "Continuing ahead with $u\n";
114                                 next;
115                         }
116                 } else {
117                         $fetch->{$pathname} = $refname;
118                 }
119         }
120 }

I don't see anything special in r332. Any ideas what's wrong and how it can be fixed? It's definitely not about quoting apostrophes or quotation marks, as they aren't there.

rnc commented 11 years ago

I'm also seeing that running it on https://xmappr.googlecode.com/svn/trunk (using Fedora F18 beta and git 1.8.0.2):

r170 = 92d4ae355533f81ecc80e04352f7b40e65f1e6e3 (refs/remotes/svn/trunk)
Found possible branch point: https://xmappr.googlecode.com/svn/trunk => https://xmappr.googlecode.com/svn/tags/0.9.0, 170
Use of uninitialized value $u in substitution (s///) at /usr/share/perl5/vendor_perl/Git/SVN.pm line 106.
Use of uninitialized value $u in concatenation (.) or string at /usr/share/perl5/vendor_perl/Git/SVN.pm line 106.
refs/remotes/svn/trunk: 'https://xmappr.googlecode.com/svn' not found in ''

command failed:
2>&1 git svn fetch 
snowyu commented 11 years ago

It's git-svn bug.

TravisTheTechie commented 11 years ago

Given this error, I followed the advice from http://stackoverflow.com/questions/3009738/what-does-this-svn2git-error-mean/4434188#4434188 and removed the duplicate entries under the remotes svn section in my .git/config. svn2git --rebase worked like a charm after that.

amedee commented 9 years ago

Given that this is a git-svn bug, where does one report the bug so that it gets fixed? I'm getting tired of removing duplicate entries every couple of minutes and I have a several gigabyte SVN repo to process, with almost 15 years of commits.

amedee commented 9 years ago

This bug was first noticed 2 years ago, it was confirmed to be a git-svn bug, and nothing has been done since. So I decided to take action. I have created a bug report for Git (git-svn) at Ubuntu Launchpad: https://bugs.launchpad.net/ubuntu/+source/git/+bug/1403767

nirvdrum commented 9 years ago

Thanks @amedee.

trash-80 commented 8 years ago

This issue seems to happen because of the password issue. I ran into this issue after finally fixing the password issue mentioned in #59 and #195. Removing all lines containing tags and branches (not just the duplicates) from .git/config allowed me to continue.

sytkov commented 8 years ago

Thank you, @the-real-trash80 . Removal of svn remotes section in .git/config worked for me too.

jekriske-lilly commented 8 years ago

Will this be automatic anytime soon?