annotate: fix -S parameter to take a string
In the conversion to Getopt::Long, the -S / --rev-list parameter stopped working. We need to tell Getopt::Long that it is a string. As a bonus, the open() now does some useful error handling. Signed-off-by: Martin Langhoff <martin@catalyst.net.nz> Signed-off-by: Junio C Hamano <junkio@cox.net>
Martin Langhoff committed
Mar 2, 2006 at 17:24 UTC
009315499e789d241998fcc5add1f109af8ba0e6
1 file changed
+3
-2
git-annotate.perl
+3
-2
@@ -31,7 +31,7 @@ our ($help, $longrev, $rename, $starting_rev, $rev_file) = (0, 0, 1);
31
my $rc = GetOptions( "long|l" => \$longrev,
32
"help|h" => \$help,
33
"rename|r" => \$rename,
34
- "rev-file|S" => \$rev_file);
34
+ "rev-file|S=s" => \$rev_file);
35
if (!$rc or $help) {
36
usage();
37
}
@@ -174,7 +174,8 @@ sub git_rev_list {
174
175
my $revlist;
176
if ($rev_file) {
177
- open($revlist, '<' . $rev_file);
177
+ open($revlist, '<' . $rev_file)
178
+ or die "Failed to open $rev_file : $!";
179
} else {
180
$revlist = open_pipe("git-rev-list","--parents","--remove-empty",$rev,"--",$file)
181
or die "Failed to exec git-rev-list: $!";