@matheusbsbs / matheus-bagliano / commits / d2feb01aa5
Fork 0

git-cvsserver: no longer use deprecated 'git-subcommand' commands

git-cvsserver still references git commands like 'git-config', which is depcrecated. This commit changes git-cvsserver to use the 'git subcommand' form. Sylvain Beucler reported the problem through http://bugs.debian.org/536067 Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Gerrit Pape committed Sep 2, 2009 at 09:23 UTC d2feb01aa580843261c25d8609369d17bcdf6028
1 file changed +20 -20
git-cvsserver.perl
+20 -20
@@ -285,7 +285,7 @@ sub req_Root
285 return 0;
286 }
287
288 - my @gitvars = `git-config -l`;
288 + my @gitvars = `git config -l`;
289 if ($?) {
290 print "E problems executing git-config on the server -- this is not a git repository or the PATH is not set correctly.\n";
291 print "E \n";
@@ -702,7 +702,7 @@ sub req_Modified
702 # Save the file data in $state
703 $state->{entries}{$state->{directory}.$data}{modified_filename} = $filename;
704 $state->{entries}{$state->{directory}.$data}{modified_mode} = $mode;
705 - $state->{entries}{$state->{directory}.$data}{modified_hash} = `git-hash-object $filename`;
705 + $state->{entries}{$state->{directory}.$data}{modified_hash} = `git hash-object $filename`;
706 $state->{entries}{$state->{directory}.$data}{modified_hash} =~ s/\s.*$//s;
707
708 #$log->debug("req_Modified : file=$data mode=$mode size=$size");
@@ -1289,7 +1289,7 @@ sub req_ci
1289
1290 # do a checkout of the file if it is part of this tree
1291 if ($wrev) {
1292 - system('git-checkout-index', '-f', '-u', $filename);
1292 + system('git', 'checkout-index', '-f', '-u', $filename);
1293 unless ($? == 0) {
1294 die "Error running git-checkout-index -f -u $filename : $!";
1295 }
@@ -1331,15 +1331,15 @@ sub req_ci
1331 {
1332 $log->info("Removing file '$filename'");
1333 unlink($filename);
1334 - system("git-update-index", "--remove", $filename);
1334 + system("git", "update-index", "--remove", $filename);
1335 }
1336 elsif ( $addflag )
1337 {
1338 $log->info("Adding file '$filename'");
1339 - system("git-update-index", "--add", $filename);
1339 + system("git", "update-index", "--add", $filename);
1340 } else {
1341 $log->info("Updating file '$filename'");
1342 - system("git-update-index", $filename);
1342 + system("git", "update-index", $filename);
1343 }
1344 }
1345
@@ -1351,7 +1351,7 @@ sub req_ci
1351 return;
1352 }
1353
1354 - my $treehash = `git-write-tree`;
1354 + my $treehash = `git write-tree`;
1355 chomp $treehash;
1356
1357 $log->debug("Treehash : $treehash, Parenthash : $parenthash");
@@ -1368,7 +1368,7 @@ sub req_ci
1368 }
1369 close $msg_fh;
1370
1371 - my $commithash = `git-commit-tree $treehash -p $parenthash < $msg_filename`;
1371 + my $commithash = `git commit-tree $treehash -p $parenthash < $msg_filename`;
1372 chomp($commithash);
1373 $log->info("Commit hash : $commithash");
1374
@@ -1821,7 +1821,7 @@ sub req_annotate
1821 # TODO: if we got a revision from the client, use that instead
1822 # to look up the commithash in sqlite (still good to default to
1823 # the current head as we do now)
1824 - system("git-read-tree", $lastseenin);
1824 + system("git", "read-tree", $lastseenin);
1825 unless ($? == 0)
1826 {
1827 print "E error running git-read-tree $lastseenin $ENV{GIT_INDEX_FILE} $!\n";
@@ -1830,7 +1830,7 @@ sub req_annotate
1830 $log->info("Created index '$ENV{GIT_INDEX_FILE}' with commit $lastseenin - exit status $?");
1831
1832 # do a checkout of the file
1833 - system('git-checkout-index', '-f', '-u', $filename);
1833 + system('git', 'checkout-index', '-f', '-u', $filename);
1834 unless ($? == 0) {
1835 print "E error running git-checkout-index -f -u $filename : $!\n";
1836 return;
@@ -1861,7 +1861,7 @@ sub req_annotate
1861 close ANNOTATEHINTS
1862 or (print "E failed to write $a_hints: $!\n"), return;
1863
1864 - my @cmd = (qw(git-annotate -l -S), $a_hints, $filename);
1864 + my @cmd = (qw(git annotate -l -S), $a_hints, $filename);
1865 if (!open(ANNOTATE, "-|", @cmd)) {
1866 print "E error invoking ". join(' ',@cmd) .": $!\n";
1867 return;
@@ -2078,17 +2078,17 @@ sub transmitfile
2078
2079 die "Need filehash" unless ( defined ( $filehash ) and $filehash =~ /^[a-zA-Z0-9]{40}$/ );
2080
2081 - my $type = `git-cat-file -t $filehash`;
2081 + my $type = `git cat-file -t $filehash`;
2082 chomp $type;
2083
2084 die ( "Invalid type '$type' (expected 'blob')" ) unless ( defined ( $type ) and $type eq "blob" );
2085
2086 - my $size = `git-cat-file -s $filehash`;
2086 + my $size = `git cat-file -s $filehash`;
2087 chomp $size;
2088
2089 $log->debug("transmitfile($filehash) size=$size, type=$type");
2090
2091 - if ( open my $fh, '-|', "git-cat-file", "blob", $filehash )
2091 + if ( open my $fh, '-|', "git", "cat-file", "blob", $filehash )
2092 {
2093 if ( defined ( $options->{targetfile} ) )
2094 {
@@ -2935,7 +2935,7 @@ sub update
2935 push @git_log_params, $self->{module};
2936 }
2937 # git-rev-list is the backend / plumbing version of git-log
2938 - open(GITLOG, '-|', 'git-rev-list', @git_log_params) or die "Cannot call git-rev-list: $!";
2938 + open(GITLOG, '-|', 'git', 'rev-list', @git_log_params) or die "Cannot call git-rev-list: $!";
2939
2940 my @commits;
2941
@@ -3021,7 +3021,7 @@ sub update
3021 next;
3022 }
3023 my $base = eval {
3024 - safe_pipe_capture('git-merge-base',
3024 + safe_pipe_capture('git', 'merge-base',
3025 $lastpicked, $parent);
3026 };
3027 # The two branches may not be related at all,
@@ -3033,7 +3033,7 @@ sub update
3033 if ($base) {
3034 my @merged;
3035 # print "want to log between $base $parent \n";
3036 - open(GITLOG, '-|', 'git-log', '--pretty=medium', "$base..$parent")
3036 + open(GITLOG, '-|', 'git', 'log', '--pretty=medium', "$base..$parent")
3037 or die "Cannot call git-log: $!";
3038 my $mergedhash;
3039 while (<GITLOG>) {
@@ -3075,7 +3075,7 @@ sub update
3075
3076 if ( defined ( $lastpicked ) )
3077 {
3078 - my $filepipe = open(FILELIST, '-|', 'git-diff-tree', '-z', '-r', $lastpicked, $commit->{hash}) or die("Cannot call git-diff-tree : $!");
3078 + my $filepipe = open(FILELIST, '-|', 'git', 'diff-tree', '-z', '-r', $lastpicked, $commit->{hash}) or die("Cannot call git-diff-tree : $!");
3079 local ($/) = "\0";
3080 while ( <FILELIST> )
3081 {
@@ -3149,7 +3149,7 @@ sub update
3149 # this is used to detect files removed from the repo
3150 my $seen_files = {};
3151
3152 - my $filepipe = open(FILELIST, '-|', 'git-ls-tree', '-z', '-r', $commit->{hash}) or die("Cannot call git-ls-tree : $!");
3152 + my $filepipe = open(FILELIST, '-|', 'git', 'ls-tree', '-z', '-r', $commit->{hash}) or die("Cannot call git-ls-tree : $!");
3153 local $/ = "\0";
3154 while ( <FILELIST> )
3155 {
@@ -3451,7 +3451,7 @@ sub commitmessage
3451 return $message;
3452 }
3453
3454 - my @lines = safe_pipe_capture("git-cat-file", "commit", $commithash);
3454 + my @lines = safe_pipe_capture("git", "cat-file", "commit", $commithash);
3455 shift @lines while ( $lines[0] =~ /\S/ );
3456 $message = join("",@lines);
3457 $message .= " " if ( $message =~ /\n$/ );