aboutsummaryrefslogtreecommitdiffstats
path: root/git-log-script
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@osdl.org>2005-07-26 20:04:22 -0700
committerJunio C Hamano <junkio@cox.net>2005-07-27 11:53:48 -0700
commitb134922992e3051e7095b1e76a89361fea86206d (patch)
tree73000ff9f50247d6fa79ef6868a09ecd1e418c2b /git-log-script
parent9969b649999a04d6ce8eebccfc1ee766f6e5377a (diff)
downloadgit-b134922992e3051e7095b1e76a89361fea86206d.tar.gz
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 <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-log-script')
-rwxr-xr-xgit-log-script2
1 files changed, 2 insertions, 0 deletions
diff --git a/git-log-script b/git-log-script
index 049d02ea14..24d1e83949 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}