{"thread":{"id":"35904","subject":"Problems while converting complex repository from SVN","startedAt":"2014-02-18T10:27:33Z","lastAt":"2014-02-18T10:27:33Z","messageCount":1,"participants":["Mathy Vanvoorden"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"234959","messageId":"197e3eca78fa1e827466d2a9387db48e@webmail.mvision.be","threadId":"35904","inReplyTo":null,"subject":"Problems while converting complex repository from SVN","fromName":"Mathy Vanvoorden","fromEmail":"mathy@vanvoorden.be","sentAt":"2014-02-18T10:27:33Z","receivedAt":"2014-02-18T10:27:33Z","isPatch":false,"sender":{"key":"mathy@vanvoorden.be","avatar":null},"body":"Hi,\n\nI had some issues while converting our current SVN repository to a GIT \nrepository. The old repository has a lot of strange history in it making \nit far from easy to convert it but for some issues I had to modify the \nconvert scripts.\n\nAs I don't know the internals of GIT or git-svn enough I don't know if \nthese are actually bugs or not. I will also not produce and submit \npatches to fix this as I don't know enough Perl to know if maybe it can \nbe solved in a better way or that it should be solved at all.\n\n1. issue with git-svn dying because git could not find the refname. I \nnoticed that in the function resolve_local_globs it was actually passing \ndesanitized names to the cmt_metadata function, so I changed the code to \nuse sanitized names, trying to keep the rest of the script (which I \ndon't pretend to understand) intact:\n\nsub resolve_local_globs {\n     my ($url, $fetch, $glob_spec) = @_;\n     return unless defined $glob_spec;\n     my $ref = $glob_spec->{ref};\n     my $path = $glob_spec->{path};\n     foreach (command(qw#for-each-ref --format=%(refname) refs/#)) {\n         next unless m#^$ref->{regex}$#;\n         my $p = $1;\n         my $pathname = $path->full_path($p);\n         my $svnpathname = desanitize_refname($pathname);\n         my $refname = $ref->full_path($p);\n         my $svnrefname = desanitize_refname($refname);\n         if (my $existing = $fetch->{$svnpathname}) {\n             if ($existing ne $svnrefname) {\n                 die \"Refspec conflict:\\n\",\n                     \"existing: $existing\\n\",\n                     \" globbed: $svnrefname\\n\";\n             }\n             my $u = (::cmt_metadata(\"$refname\"))[0];\n             $u =~ s!^\\Q$url\\E(/|$)!! or die\n               \"$svnrefname: '$url' not found in '$u'\\n\";\n             if ($pathname ne $u) {\n                 warn \"W: Refspec glob conflict \",\n                      \"(ref: $svnrefname):\\n\",\n                      \"expected path: $pathname\\n\",\n                      \"    real path: $u\\n\",\n                      \"Continuing ahead with $u\\n\";\n                 next;\n             }\n         } else {\n             $fetch->{$svnpathname} = $svnrefname;\n         }\n     }\n}\n\n\n2. issue with an @ being present in a branch name. A first branch was \ncreated just fine, but a second branch was created from that branch \nwhich failed.\n\nThe following message (simplified for confidentiality reasons) was \nshown while trying to branch 'blabla bla@bla blabla' to 'blabla blabla'\n\nFound possible branch point: \nsvn://localhost/path/to/branch/blabla%20bla@bla%20blabla => \nsvn://localhost/path/to/branches/blabla%20blabla, 13486\nrefs/remotes/origin/branches/blabla bla@bla blabla: 'svn://localhost' \nnot found in 'svn://bla%20blabla'\n\nI found out that the git-svn-id was actually being wrongly initiated to \n'svn://bla%20blabla'. This is due to a mistake in the regex that is used \nin remove_username.\n\nIt was:\n\t$_[0] =~ s{^([^:]*://)[^@]+@}{$1};\nI changed it to\n\t$_[0] =~ s{^([^:]*://)[^@/]+@}{$1};\n\nAnd it works.\n\n\nI did all this using the standard Git package for Windows, release \n1.8.5.2\n\nPS: I tried to send this from my work email several times but I think \nthe mail server can't handle the greylisting so I apologize if the mails \nstill end up in the list.\n\n-- \n\nMet vriendelijke groeten,\nBest regards,\n\nMathy Vanvoorden\n"}]}