Skip to content

Commit 7cff3b6

Browse files
committed
cvsexportcommit: do not run git programs in dashed form
This ancient script runs "git-foo" all over the place, which is OK for a scripted Porcelain in the Git suite, but asking "git" to dispatch to subcommands is the usual way these days. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 675df19 commit 7cff3b6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

git-cvsexportcommit.perl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
# Remember where GIT_DIR is before changing to CVS checkout
3131
unless ($ENV{GIT_DIR}) {
3232
# No GIT_DIR set. Figure it out for ourselves
33-
my $gd =`git-rev-parse --git-dir`;
33+
my $gd =`git rev-parse --git-dir`;
3434
chomp($gd);
3535
$ENV{GIT_DIR} = $gd;
3636
}
@@ -66,7 +66,7 @@
6666
# resolve target commit
6767
my $commit;
6868
$commit = pop @ARGV;
69-
$commit = safe_pipe_capture('git-rev-parse', '--verify', "$commit^0");
69+
$commit = safe_pipe_capture('git', 'rev-parse', '--verify', "$commit^0");
7070
chomp $commit;
7171
if ($?) {
7272
die "The commit reference $commit did not resolve!";
@@ -76,15 +76,15 @@
7676
my $parent;
7777
if (@ARGV) {
7878
$parent = pop @ARGV;
79-
$parent = safe_pipe_capture('git-rev-parse', '--verify', "$parent^0");
79+
$parent = safe_pipe_capture('git', 'rev-parse', '--verify', "$parent^0");
8080
chomp $parent;
8181
if ($?) {
8282
die "The parent reference did not resolve!";
8383
}
8484
}
8585

8686
# find parents from the commit itself
87-
my @commit = safe_pipe_capture('git-cat-file', 'commit', $commit);
87+
my @commit = safe_pipe_capture('git', 'cat-file', 'commit', $commit);
8888
my @parents;
8989
my $committer;
9090
my $author;
@@ -162,9 +162,9 @@
162162
close MSG;
163163

164164
if ($parent eq $noparent) {
165-
`git-diff-tree --binary -p --root $commit >.cvsexportcommit.diff`;# || die "Cannot diff";
165+
`git diff-tree --binary -p --root $commit >.cvsexportcommit.diff`;# || die "Cannot diff";
166166
} else {
167-
`git-diff-tree --binary -p $parent $commit >.cvsexportcommit.diff`;# || die "Cannot diff";
167+
`git diff-tree --binary -p $parent $commit >.cvsexportcommit.diff`;# || die "Cannot diff";
168168
}
169169

170170
## apply non-binary changes
@@ -178,7 +178,7 @@
178178
print "Checking if patch will apply\n";
179179

180180
my @stat;
181-
open APPLY, "GIT_INDEX_FILE=$tmpdir/index git-apply $context --summary --numstat<.cvsexportcommit.diff|" || die "cannot patch";
181+
open APPLY, "GIT_INDEX_FILE=$tmpdir/index git apply $context --summary --numstat<.cvsexportcommit.diff|" || die "cannot patch";
182182
@stat=<APPLY>;
183183
close APPLY || die "Cannot patch";
184184
my (@bfiles,@files,@afiles,@dfiles);
@@ -333,7 +333,7 @@
333333
if ($opt_W) {
334334
system("git checkout -q $commit^0") && die "cannot patch";
335335
} else {
336-
`GIT_INDEX_FILE=$tmpdir/index git-apply $context --summary --numstat --apply <.cvsexportcommit.diff` || die "cannot patch";
336+
`GIT_INDEX_FILE=$tmpdir/index git apply $context --summary --numstat --apply <.cvsexportcommit.diff` || die "cannot patch";
337337
}
338338

339339
print "Patch applied successfully. Adding new files and directories to CVS\n";

0 commit comments

Comments
 (0)