Pass options to underlying git-rev-list from show-branches.

This lets you say "git show-branches --max-count=30".

Signed-off-by: Junio C Hamano <junkio@cox.net>
maint
Junio C Hamano 2005-08-16 13:01:39 -07:00
parent 30b96fcef1
commit 86947d72d4
1 changed files with 16 additions and 8 deletions

View File

@ -5,15 +5,23 @@


. git-sh-setup-script || die "Not a git repository" . git-sh-setup-script || die "Not a git repository"


usage () {
die "usage: $0 <ref>..."
}

headref=`readlink $GIT_DIR/HEAD` headref=`readlink $GIT_DIR/HEAD`
case "$#" in
0) case "$(git-rev-parse --no-revs)" in '') ;; *) usage ;; esac
set x `cd $GIT_DIR/refs && revs=$(git-rev-parse --revs-only --symbolic --no-flags "$@")
find heads -type f -print | flags=$(git-rev-parse --revs-only --flags "$@")
sed -e 's|heads/||' | case "$revs" in
sort` '')
revs=$(git-rev-parse --symbolic --all | sed -ne 's|^refs/heads/||p' |
sort)
shift ;; shift ;;
esac esac
set x $revs
shift


hh= in= hh= in=
for ref for ref
@ -22,7 +30,7 @@ do
*/"$ref") H='*' ;; */"$ref") H='*' ;;
*) H='!' ;; *) H='!' ;;
esac esac
h=`git-rev-parse --verify "$ref^0"` || exit h=`git-rev-parse --verify "$ref^0" 2>/dev/null` || continue
l=`git-log-script --max-count=1 --pretty=oneline "$h" | l=`git-log-script --max-count=1 --pretty=oneline "$h" |
sed -e 's/^[^ ]* //'` sed -e 's/^[^ ]* //'`
hh="$hh $h" hh="$hh $h"
@ -32,7 +40,7 @@ done
set x $hh set x $hh
shift shift


git-rev-list --pretty=oneline "$@" | git-rev-list --pretty=oneline $flags $@ |
while read v l while read v l
do do
in='' in=''