summaryrefslogtreecommitdiff
path: root/git-log-script
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@osdl.org>2005-07-27 03:04:22 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-07-27 18:53:48 (GMT)
commitb134922992e3051e7095b1e76a89361fea86206d (patch)
tree73000ff9f50247d6fa79ef6868a09ecd1e418c2b /git-log-script
parent9969b649999a04d6ce8eebccfc1ee766f6e5377a (diff)
downloadgit-b134922992e3051e7095b1e76a89361fea86206d.zip
git-b134922992e3051e7095b1e76a89361fea86206d.tar.gz
git-b134922992e3051e7095b1e76a89361fea86206d.tar.bz2
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 049d02e..24d1e83 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}