X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=git-cvsimport.perl;h=cc0eed29463735950b0b0ec41de7197006fc204a;hb=8cd4177d5ef651c8acb9c1f113a076e6fae2e1c2;hp=565f4f1b32c8b9d96df3602ab2d729cf3529836a;hpb=c1067050ce58b5b39f528fe634732da858664603;p=git.git diff --git a/git-cvsimport.perl b/git-cvsimport.perl index 565f4f1b..cc0eed29 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -510,7 +510,7 @@ unless($pid) { my $state = 0; -my($patchset,$date,$author,$branch,$ancestor,$tag,$logmsg); +my($patchset,$date,$author_name,$author_email,$branch,$ancestor,$tag,$logmsg); my(@old,@new); my $commit = sub { my $pid; @@ -567,6 +567,7 @@ my $commit = sub { unless($pid) { $pr->writer(); $pw->reader(); + open(OUT,">&STDOUT"); dup2($pw->fileno(),0); dup2($pr->fileno(),1); $pr->close(); @@ -584,18 +585,17 @@ my $commit = sub { if ( -e "$git_dir/refs/heads/$mparent") { $mparent = get_headref($mparent, $git_dir); push @par, '-p', $mparent; - # printing here breaks import # - # # print "Merge parent branch: $mparent\n" if $opt_v; + print OUT "Merge parent branch: $mparent\n" if $opt_v; } - } + } } exec("env", - "GIT_AUTHOR_NAME=$author", - "GIT_AUTHOR_EMAIL=$author", + "GIT_AUTHOR_NAME=$author_name", + "GIT_AUTHOR_EMAIL=$author_email", "GIT_AUTHOR_DATE=".strftime("+0000 %Y-%m-%d %H:%M:%S",gmtime($date)), - "GIT_COMMITTER_NAME=$author", - "GIT_COMMITTER_EMAIL=$author", + "GIT_COMMITTER_NAME=$author_name", + "GIT_COMMITTER_EMAIL=$author_email", "GIT_COMMITTER_DATE=".strftime("+0000 %Y-%m-%d %H:%M:%S",gmtime($date)), "git-commit-tree", $tree,@par); die "Cannot exec git-commit-tree: $!\n"; @@ -638,7 +638,7 @@ my $commit = sub { print $out "object $cid\n". "type commit\n". "tag $xtag\n". - "tagger $author <$author>\n" + "tagger $author_name <$author_email>\n" or die "Cannot create tag object $xtag: $!\n"; close($out) or die "Cannot create tag object $xtag: $!\n"; @@ -683,7 +683,11 @@ while() { $state=3; } elsif($state == 3 and s/^Author:\s+//) { s/\s+$//; - $author = $_; + if (/^(.*?)\s+<(.*)>/) { + ($author_name, $author_email) = ($1, $2); + } else { + $author_name = $author_email = $_; + } $state = 4; } elsif($state == 4 and s/^Branch:\s+//) { s/\s+$//;