diff options
author | Junio C Hamano <junkio@cox.net> | 2006-04-28 16:57:32 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-04-28 16:57:32 -0700 |
commit | 89719209f48fe7d9694710795b1ec1d5fd7ebfc0 (patch) | |
tree | 4c264196192c6aa0b3a60d337f43ec082add3293 /git-annotate.perl | |
parent | bd346f105dc6f343eb577e4b25dbc1fa098cff33 (diff) | |
parent | aa6bf0eb6489d652c5877d65160ed33c857afa74 (diff) | |
download | git-89719209f48fe7d9694710795b1ec1d5fd7ebfc0.tar.gz |
Merge branch 'fix'
* fix:
Fix trivial typo in git-log man page.
Properly render asciidoc "callouts" in git man pages.
Fix up remaining man pages that use asciidoc "callouts".
Update the git-branch man page to include the "-r" option,
annotate: display usage information if no filename was given
annotate: fix warning about uninitialized scalar
git-am --resolved: more usable error message.
Diffstat (limited to 'git-annotate.perl')
-rwxr-xr-x | git-annotate.perl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/git-annotate.perl b/git-annotate.perl index 9df72a1662..a6a7a482cd 100755 --- a/git-annotate.perl +++ b/git-annotate.perl @@ -10,9 +10,10 @@ use warnings; use strict; use Getopt::Long; use POSIX qw(strftime gmtime); +use File::Basename qw(basename dirname); sub usage() { - print STDERR 'Usage: ${\basename $0} [-s] [-S revs-file] file [ revision ] + print STDERR "Usage: ${\basename $0} [-s] [-S revs-file] file [ revision ] -l, --long Show long rev (Defaults off) -t, --time @@ -23,7 +24,7 @@ sub usage() { Use revs from revs-file instead of calling git-rev-list -h, --help This message. -'; +"; exit(1); } @@ -35,7 +36,7 @@ my $rc = GetOptions( "long|l" => \$longrev, "help|h" => \$help, "rename|r" => \$rename, "rev-file|S=s" => \$rev_file); -if (!$rc or $help) { +if (!$rc or $help or !@ARGV) { usage(); } @@ -208,6 +209,9 @@ sub find_parent_renames { while (my $change = <$patch>) { chomp $change; my $filename = <$patch>; + if (!defined $filename) { + next; + } chomp $filename; if ($change =~ m/^[AMD]$/ ) { |