From: Linus Torvalds Date: Wed, 27 Jul 2005 03:04:22 +0000 (-0700) Subject: git-log: make sure we have some commit to start from. X-Git-Tag: v0.99.3~54 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b1349229;p=git.git git-log: make sure we have some commit to start from. 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 Signed-off-by: Junio C Hamano --- diff --git a/git-log-script b/git-log-script index 049d02ea1..24d1e8394 100755 --- a/git-log-script +++ b/git-log-script @@ -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}