]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-svnimport.perl
Fix installation of templates on ancient systems.
[thirdparty/git.git] / git-svnimport.perl
index 61f559f0a8ae69c04cfe9d8700591cedda41989c..26dc45479532a78febb511bf36017d6106513e70 100755 (executable)
@@ -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"