@@ -609,16 +609,16 @@ sub munge_user_filename {
609
609
my %index ; # holds filenames of one index per branch
610
610
611
611
unless (-d $git_dir ) {
612
- system (" git- init" );
612
+ system (qw( git init) );
613
613
die " Cannot init the GIT db at $git_tree : $? \n " if $? ;
614
- system (" git- read-tree" );
614
+ system (qw( git read-tree) );
615
615
die " Cannot init an empty tree: $? \n " if $? ;
616
616
617
617
$last_branch = $opt_o ;
618
618
$orig_branch = " " ;
619
619
} else {
620
- open (F, " git- symbolic-ref HEAD | " ) or
621
- die " Cannot run git- symbolic-ref: $! \n " ;
620
+ open (F, " -| " , qw( git symbolic-ref HEAD) ) or
621
+ die " Cannot run git symbolic-ref: $! \n " ;
622
622
chomp ($last_branch = <F>);
623
623
$last_branch = basename($last_branch );
624
624
close (F);
@@ -627,12 +627,12 @@ sub munge_user_filename {
627
627
$last_branch = " master" ;
628
628
}
629
629
$orig_branch = $last_branch ;
630
- $tip_at_start = ` git- rev-parse --verify HEAD` ;
630
+ $tip_at_start = ` git rev-parse --verify HEAD` ;
631
631
632
632
# Get the last import timestamps
633
633
my $fmt = ' ($ref, $author) = (%(refname), %(author));' ;
634
- open (H, " git- for-each-ref --perl --format=' $fmt ' $remote | " ) or
635
- die " Cannot run git- for-each-ref: $! \n " ;
634
+ my @cmd = ( ' git ' , ' for-each-ref' , ' --perl' , " --format=$fmt " , $remote );
635
+ open (H, " -| " , @cmd ) or die " Cannot run git for-each-ref: $! \n " ;
636
636
while (defined (my $entry = <H>)) {
637
637
my ($ref , $author );
638
638
eval ($entry ) || die " cannot eval refs list: $@ " ;
@@ -687,7 +687,7 @@ sub munge_user_filename {
687
687
print $cvspsfh $_ ;
688
688
}
689
689
close CVSPS;
690
- $? == 0 or die " git- cvsimport: fatal: cvsps reported error\n " ;
690
+ $? == 0 or die " git cvsimport: fatal: cvsps reported error\n " ;
691
691
close $cvspsfh ;
692
692
} else {
693
693
$cvspsfile = munge_user_filename($opt_P );
@@ -716,27 +716,27 @@ sub munge_user_filename {
716
716
sub update_index (\@\@) {
717
717
my $old = shift ;
718
718
my $new = shift ;
719
- open (my $fh , ' |-' , qw( git- update-index -z --index-info) )
720
- or die " unable to open git- update-index: $! " ;
719
+ open (my $fh , ' |-' , qw( git update-index -z --index-info) )
720
+ or die " unable to open git update-index: $! " ;
721
721
print $fh
722
722
(map { " 0 0000000000000000000000000000000000000000\t $_ \0 " }
723
723
@$old ),
724
724
(map { ' 100' . sprintf (' %o' , $_ -> [0]) . " $_ ->[1]\t $_ ->[2]\0 " }
725
725
@$new )
726
- or die " unable to write to git- update-index: $! " ;
726
+ or die " unable to write to git update-index: $! " ;
727
727
close $fh
728
- or die " unable to write to git- update-index: $! " ;
729
- $? and die " git- update-index reported error: $? " ;
728
+ or die " unable to write to git update-index: $! " ;
729
+ $? and die " git update-index reported error: $? " ;
730
730
}
731
731
732
732
sub write_tree () {
733
- open (my $fh , ' -|' , qw( git- write-tree) )
734
- or die " unable to open git- write-tree: $! " ;
733
+ open (my $fh , ' -|' , qw( git write-tree) )
734
+ or die " unable to open git write-tree: $! " ;
735
735
chomp (my $tree = <$fh >);
736
736
is_sha1($tree )
737
737
or die " Cannot get tree id ($tree ): $! " ;
738
738
close ($fh )
739
- or die " Error running git- write-tree: $? \n " ;
739
+ or die " Error running git write-tree: $? \n " ;
740
740
print " Tree ID $tree \n " if $opt_v ;
741
741
return $tree ;
742
742
}
@@ -751,7 +751,7 @@ sub commit {
751
751
if ($branch eq $opt_o && !$index {branch } &&
752
752
!get_headref(" $remote /$branch " )) {
753
753
# looks like an initial commit
754
- # use the index primed by git- init
754
+ # use the index primed by git init
755
755
$ENV {GIT_INDEX_FILE } = " $git_dir /index" ;
756
756
$index {$branch } = " $git_dir /index" ;
757
757
} else {
@@ -761,9 +761,9 @@ sub commit {
761
761
$index {$branch } = tmpnam();
762
762
$ENV {GIT_INDEX_FILE } = $index {$branch };
763
763
if ($ancestor ) {
764
- system (" git- read-tree" , " $remote /$ancestor " );
764
+ system (" git" , " read-tree" , " $remote /$ancestor " );
765
765
} else {
766
- system (" git- read-tree" , " $remote /$branch " );
766
+ system (" git" , " read-tree" , " $remote /$branch " );
767
767
}
768
768
die " read-tree failed: $? \n " if $? ;
769
769
}
@@ -798,7 +798,7 @@ sub commit {
798
798
$ENV {GIT_COMMITTER_EMAIL } = $author_email ;
799
799
$ENV {GIT_COMMITTER_DATE } = $commit_date ;
800
800
my $pid = open2(my $commit_read , my $commit_write ,
801
- ' git- commit-tree' , $tree , @commit_args );
801
+ ' git' , ' commit-tree' , $tree , @commit_args );
802
802
803
803
# compatibility with git2cvs
804
804
substr ($logmsg ,32767) = " " if length ($logmsg ) > 32767;
@@ -811,7 +811,7 @@ sub commit {
811
811
}
812
812
813
813
print ($commit_write " $logmsg \n " ) && close ($commit_write )
814
- or die " Error writing to git- commit-tree: $! \n " ;
814
+ or die " Error writing to git commit-tree: $! \n " ;
815
815
816
816
print " Committed patch $patchset ($branch $commit_date )\n " if $opt_v ;
817
817
chomp (my $cid = <$commit_read >);
@@ -820,9 +820,9 @@ sub commit {
820
820
close ($commit_read );
821
821
822
822
waitpid ($pid ,0);
823
- die " Error running git- commit-tree: $? \n " if $? ;
823
+ die " Error running git commit-tree: $? \n " if $? ;
824
824
825
- system (' git- update-ref' , " $remote /$branch " , $cid ) == 0
825
+ system (' git' , ' update-ref' , " $remote /$branch " , $cid ) == 0
826
826
or die " Cannot write branch $branch for update: $! \n " ;
827
827
828
828
if ($tag ) {
@@ -832,7 +832,7 @@ sub commit {
832
832
$xtag =~ s / [\/ ]/ $opt_s / g ;
833
833
$xtag =~ s /\[ // g ;
834
834
835
- system (' git- tag' , ' -f' , $xtag , $cid ) == 0
835
+ system (' git' , ' tag' , ' -f' , $xtag , $cid ) == 0
836
836
or die " Cannot create tag $xtag : $! \n " ;
837
837
838
838
print " Created tag '$xtag ' on '$branch '\n " if $opt_v ;
@@ -969,7 +969,7 @@ sub commit {
969
969
my $pid = open (my $F , ' -|' );
970
970
die $! unless defined $pid ;
971
971
if (!$pid ) {
972
- exec (" git- hash-object" , " -w" , $tmpname )
972
+ exec (" git" , " hash-object" , " -w" , $tmpname )
973
973
or die " Cannot create object: $! \n " ;
974
974
}
975
975
my $sha = <$F >;
@@ -993,7 +993,7 @@ sub commit {
993
993
}
994
994
commit();
995
995
if (($commitcount & 1023) == 0) {
996
- system(" git repack -a -d" );
996
+ system(qw( git repack -a -d) );
997
997
}
998
998
$state = 1;
999
999
} elsif ($state == 11 and /^-+$/ ) {
@@ -1013,11 +1013,11 @@ sub commit {
1013
1013
# The heuristic of repacking every 1024 commits can leave a
1014
1014
# lot of unpacked data. If there is more than 1MB worth of
1015
1015
# not-packed objects, repack once more.
1016
- my $line = `git- count-objects`;
1016
+ my $line = `git count-objects`;
1017
1017
if ($line =~ /^(\d +) objects, (\d +) kilobytes$/ ) {
1018
1018
my ($n_objects , $kb ) = ($1 , $2 );
1019
1019
1024 < $kb
1020
- and system(" git repack -a -d" );
1020
+ and system(qw( git repack -a -d) );
1021
1021
}
1022
1022
1023
1023
foreach my $git_index (values %index ) {
@@ -1038,28 +1038,28 @@ sub commit {
1038
1038
if ($opt_i ) {
1039
1039
exit 0;
1040
1040
}
1041
- my $tip_at_end = `git- rev-parse --verify HEAD`;
1041
+ my $tip_at_end = `git rev-parse --verify HEAD`;
1042
1042
if ($tip_at_start ne $tip_at_end ) {
1043
1043
for ($tip_at_start , $tip_at_end ) { chomp; }
1044
1044
print "Fetched into the current branch.\n " if $opt_v ;
1045
- system(qw(git- read-tree -u -m),
1045
+ system(qw(git read-tree -u -m),
1046
1046
$tip_at_start , $tip_at_end );
1047
1047
die "Fast-forward update failed: $? \n" if $? ;
1048
1048
}
1049
1049
else {
1050
- system(qw(git- merge cvsimport HEAD), " $remote /$opt_o " );
1050
+ system(qw(git merge cvsimport HEAD), " $remote /$opt_o " );
1051
1051
die " Could not merge $opt_o into the current branch.\n" if $? ;
1052
1052
}
1053
1053
} else {
1054
1054
$orig_branch = " master" ;
1055
1055
print " DONE; creating $orig_branch branch\n" if $opt_v ;
1056
- system(" git- update-ref " , " refs/heads/master" , " $remote /$opt_o " )
1056
+ system(" git" , " update-ref " , " refs/heads/master" , " $remote /$opt_o " )
1057
1057
unless defined get_headref('refs/heads/master');
1058
- system(" git- symbolic-ref " , " $remote /HEAD" , " $remote /$opt_o " )
1058
+ system(" git" , " symbolic-ref " , " $remote /HEAD" , " $remote /$opt_o " )
1059
1059
if ($opt_r && $opt_o ne 'HEAD');
1060
- system('git- update-ref', 'HEAD', " $orig_branch " );
1060
+ system('git', ' update-ref', 'HEAD', " $orig_branch " );
1061
1061
unless ($opt_i ) {
1062
- system(' git checkout -f' );
1062
+ system(qw( git checkout -f) );
1063
1063
die " checkout failed: $? \n" if $? ;
1064
1064
}
1065
1065
}
0 commit comments