X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=git-svnimport.perl;h=26dc45479532a78febb511bf36017d6106513e70;hb=7ffe7098dca297016f87a7e10554e6736f7c3ae2;hp=61f559f0a8ae69c04cfe9d8700591cedda41989c;hpb=3d990f110c2e5b8df83f6ab3ef83497f43c7fd47;p=thirdparty%2Fgit.git diff --git a/git-svnimport.perl b/git-svnimport.perl index 61f559f0a8..26dc454795 100755 --- a/git-svnimport.perl +++ b/git-svnimport.perl @@ -63,10 +63,17 @@ my $svn_dir = $ARGV[1]; our @mergerx = (); if ($opt_m) { - @mergerx = ( qr/\W(?:from|of|merge|merging|merged) (\w+)/i ); + my $branch_esc = quotemeta ($branch_name); + my $trunk_esc = quotemeta ($trunk_name); + @mergerx = + ( + qr!\b(?:merg(?:ed?|ing))\b.*?\b((?:(?<=$branch_esc/)[\w\.\-]+)|(?:$trunk_esc))\b!i, + qr!\b(?:from|of)\W+((?:(?<=$branch_esc/)[\w\.\-]+)|(?:$trunk_esc))\b!i, + qr!\b(?:from|of)\W+(?:the )?([\w\.\-]+)[-\s]branch\b!i + ); } if ($opt_M) { - push (@mergerx, qr/$opt_M/); + unshift (@mergerx, qr/$opt_M/); } # Absolutize filename now, since we will have chdir'ed by the time we @@ -527,7 +534,7 @@ sub commit { my($author_name,$author_email,$dest); my(@old,@new,@parents); - if (not defined $author) { + if (not defined $author or $author eq "") { $author_name = $author_email = "unknown"; } elsif (defined $users_file) { die "User $author is not listed in $users_file\n"