From b134922992e3051e7095b1e76a89361fea86206d Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Tue, 26 Jul 2005 20:04:22 -0700 Subject: [PATCH] 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 --- git-log-script | 2 ++ 1 file changed, 2 insertions(+) diff --git a/git-log-script b/git-log-script index 049d02ea..24d1e839 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} -- 2.11.0