projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Avoid misleading success message on error
[git.git]
/
git-cvsexportcommit.perl
diff --git
a/git-cvsexportcommit.perl
b/git-cvsexportcommit.perl
index
7074b0c
..
5a8c011
100755
(executable)
--- a/
git-cvsexportcommit.perl
+++ b/
git-cvsexportcommit.perl
@@
-4,6
+4,7
@@
use strict;
use Getopt::Std;
use File::Temp qw(tempdir);
use Data::Dumper;
use Getopt::Std;
use File::Temp qw(tempdir);
use Data::Dumper;
+use File::Basename qw(basename);
unless ($ENV{GIT_DIR} && -r $ENV{GIT_DIR}){
die "GIT_DIR is not defined or is unreadable";
unless ($ENV{GIT_DIR} && -r $ENV{GIT_DIR}){
die "GIT_DIR is not defined or is unreadable";
@@
-11,7
+12,7
@@
unless ($ENV{GIT_DIR} && -r $ENV{GIT_DIR}){
our ($opt_h, $opt_p, $opt_v, $opt_c );
our ($opt_h, $opt_p, $opt_v, $opt_c );
-getopt('hpvc');
+getopt
s
('hpvc');
$opt_h && usage();
$opt_h && usage();
@@
-64,7
+65,7
@@
if ($parent) {
last;
}; # found it
die "Did not find $parent in the parents for this commit!";
last;
}; # found it
die "Did not find $parent in the parents for this commit!";
-
s
}
+ }
} else { # we don't have a parent from the cmdline...
if (@parents == 1) { # it's safe to get it from the commit
$parent = $parents[0];
} else { # we don't have a parent from the cmdline...
if (@parents == 1) { # it's safe to get it from the commit
$parent = $parents[0];
@@
-77,7
+78,7
@@
$opt_v && print "Applying to CVS commit $commit from parent $parent\n";
# grab the commit message
`git-cat-file commit $commit | sed -e '1,/^\$/d' > .msg`;
# grab the commit message
`git-cat-file commit $commit | sed -e '1,/^\$/d' > .msg`;
-$? && die "Error extracti
on
the commit message";
+$? && die "Error extracti
ng
the commit message";
my (@afiles, @dfiles, @mfiles);
my @files = `git-diff-tree -r $parent $commit`;
my (@afiles, @dfiles, @mfiles);
my @files = `git-diff-tree -r $parent $commit`;
@@
-187,9
+188,9
@@
my $cmd = "cvs commit -F .msg $commitfiles";
if ($dirtypatch) {
print "NOTE: One or more hunks failed to apply cleanly.\n";
if ($dirtypatch) {
print "NOTE: One or more hunks failed to apply cleanly.\n";
- print "Resolve the conflicts and then commit using:n";
+ print "Resolve the conflicts and then commit using:
\
n";
print "\n $cmd\n\n";
print "\n $cmd\n\n";
- exit;
+ exit
(1)
;
}
}
@@
-206,8
+207,7
@@
if ($opt_c) {
}
sub usage {
print STDERR <<END;
}
sub usage {
print STDERR <<END;
-Usage: GIT_DIR=/path/to/.gi ${\basename $0} # fetch/update GIT from CVS
- [-h] [-p] [ parent ] commit
+Usage: GIT_DIR=/path/to/.git ${\basename $0} [-h] [-p] [-v] [-c] [ parent ] commit
END
exit(1);
}
END
exit(1);
}