Code

git-log: make sure we have some commit to start from.
authorLinus Torvalds <torvalds@osdl.org>
Wed, 27 Jul 2005 03:04:22 +0000 (20:04 -0700)
committerJunio C Hamano <junkio@cox.net>
Wed, 27 Jul 2005 18:53:48 +0000 (11:53 -0700)
When no usable head/tag is specified, git log barfed with
underlying error message from rev-list, which was not helpful.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-log-script

index 049d02ea1452bca07188cacecb991a56cd97a5f1..24d1e83949a8eebb3cf6f8785f681c14ecd1115e 100755 (executable)
@@ -1,3 +1,5 @@
 #!/bin/sh
 . git-sh-setup-script || die "Not a git archive"
+revs=$(git-rev-parse --revs-only --default HEAD "$@")
+[ "$revs" ] || die "No HEAD ref"
 git-rev-list --pretty $(git-rev-parse --default HEAD "$@") | LESS=-S ${PAGER:-less}