diff options
author | Junio C Hamano <junkio@cox.net> | 2006-04-28 19:30:41 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-04-28 19:30:41 -0700 |
commit | 1d19b324fb2248802ad7fa306fae6b52e74619eb (patch) | |
tree | 8991a96ad9e32b6c9232ef33317f6275985325c1 /git-annotate.perl | |
parent | Merge branch 'jc/cache-tree' into next (diff) | |
parent | Merge branch 'fix' (diff) | |
download | tgif-1d19b324fb2248802ad7fa306fae6b52e74619eb.tar.xz |
Merge branch 'master' into next
* master:
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]$/ ) { |