Skip to content

Commit 5c08931

Browse files
Elvis Pranskevichusgitster
authored andcommitted
Use git-tag in git-cvsimport
Currently git-cvsimport tries to create tag objects directly via git-mktag in a very broken way, e.g the stuff it writes into the tagger field of the tag object doesn't really resemble the GIT_COMMITTER_IDENT. This makes gitweb and possibly other tools that try to interpret tag objects to be confused about tag date and authorship. Fix this by calling git-tag instead. This also has a nice side effect of not creating the tag object but only the lightweight tag as that's the only thing CVS has anyways. Signed-off-by: Elvis Pranskevichus <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d44c782 commit 5c08931

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

git-cvsimport.perl

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -771,31 +771,9 @@ sub commit {
771771
$xtag =~ s/\s+\*\*.*$//; # Remove stuff like ** INVALID ** and ** FUNKY **
772772
$xtag =~ tr/_/\./ if ( $opt_u );
773773
$xtag =~ s/[\/]/$opt_s/g;
774-
775-
my $pid = open2($in, $out, 'git-mktag');
776-
print $out "object $cid\n".
777-
"type commit\n".
778-
"tag $xtag\n".
779-
"tagger $author_name <$author_email>\n"
780-
or die "Cannot create tag object $xtag: $!\n";
781-
close($out)
782-
or die "Cannot create tag object $xtag: $!\n";
783-
784-
my $tagobj = <$in>;
785-
chomp $tagobj;
786-
787-
if ( !close($in) or waitpid($pid, 0) != $pid or
788-
$? != 0 or $tagobj !~ /^[0123456789abcdef]{40}$/ ) {
789-
die "Cannot create tag object $xtag: $!\n";
790-
}
791-
792-
793-
open(C,">$git_dir/refs/tags/$xtag")
774+
775+
system('git-tag', $xtag, $cid) == 0
794776
or die "Cannot create tag $xtag: $!\n";
795-
print C "$tagobj\n"
796-
or die "Cannot write tag $xtag: $!\n";
797-
close(C)
798-
or die "Cannot write tag $xtag: $!\n";
799777

800778
print "Created tag '$xtag' on '$branch'\n" if $opt_v;
801779
}

0 commit comments

Comments
 (0)