@matheusbsbs / matheus-bagliano / commits / 94c23343dc
Fork 0

Pass CVSps generated A U Thor <author@domain.xz> intact.

Alexey Nezhdanov updated CVSps to generate author-name and author-email information in its output. If the input looks like it has that already properly formatted, use that without our own munging. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Sep 30, 2005 at 01:48 UTC 94c23343dce0f556392fe8bbbba1b38cd37da481
1 file changed +11 -7
git-cvsimport.perl
+11 -7
@@ -510,7 +510,7 @@ unless($pid) {
510
511 my $state = 0;
512
513 -my($patchset,$date,$author,$branch,$ancestor,$tag,$logmsg);
513 +my($patchset,$date,$author_name,$author_email,$branch,$ancestor,$tag,$logmsg);
514 my(@old,@new);
515 my $commit = sub {
516 my $pid;
@@ -591,11 +591,11 @@ my $commit = sub {
591 }
592
593 exec("env",
594 - "GIT_AUTHOR_NAME=$author",
595 - "GIT_AUTHOR_EMAIL=$author",
594 + "GIT_AUTHOR_NAME=$author_name",
595 + "GIT_AUTHOR_EMAIL=$author_email",
596 "GIT_AUTHOR_DATE=".strftime("+0000 %Y-%m-%d %H:%M:%S",gmtime($date)),
597 - "GIT_COMMITTER_NAME=$author",
598 - "GIT_COMMITTER_EMAIL=$author",
597 + "GIT_COMMITTER_NAME=$author_name",
598 + "GIT_COMMITTER_EMAIL=$author_email",
599 "GIT_COMMITTER_DATE=".strftime("+0000 %Y-%m-%d %H:%M:%S",gmtime($date)),
600 "git-commit-tree", $tree,@par);
601 die "Cannot exec git-commit-tree: $!\n";
@@ -638,7 +638,7 @@ my $commit = sub {
638 print $out "object $cid\n".
639 "type commit\n".
640 "tag $xtag\n".
641 - "tagger $author <$author>\n"
641 + "tagger $author_name <$author_email>\n"
642 or die "Cannot create tag object $xtag: $!\n";
643 close($out)
644 or die "Cannot create tag object $xtag: $!\n";
@@ -683,7 +683,11 @@ while(<CVS>) {
683 $state=3;
684 } elsif($state == 3 and s/^Author:\s+//) {
685 s/\s+$//;
686 - $author = $_;
686 + if (/^(.*?)\s+<(.*)>/) {
687 + ($author_name, $author_email) = ($1, $2);
688 + } else {
689 + $author_name = $author_email = $_;
690 + }
691 $state = 4;
692 } elsif($state == 4 and s/^Branch:\s+//) {
693 s/\s+$//;