Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-08-17 00:01:39 +0400
committerJunio C Hamano <junkio@cox.net>2005-08-17 23:11:36 +0400
commit86947d72d422aeaaeb4c1f41b49fc7a606c96321 (patch)
tree1408b005a47563551b054d76295c3cc91073d9d7 /git-show-branches-script
parent30b96fcef1243930497a4653c6ae47291316b6b7 (diff)
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>
Diffstat (limited to 'git-show-branches-script')
-rwxr-xr-xgit-show-branches-script24
1 files changed, 16 insertions, 8 deletions
diff --git a/git-show-branches-script b/git-show-branches-script
index 263025c476..90018a9e88 100755
--- a/git-show-branches-script
+++ b/git-show-branches-script
@@ -5,15 +5,23 @@
. git-sh-setup-script || die "Not a git repository"
+usage () {
+ die "usage: $0 <ref>..."
+}
+
headref=`readlink $GIT_DIR/HEAD`
-case "$#" in
-0)
- set x `cd $GIT_DIR/refs &&
- find heads -type f -print |
- sed -e 's|heads/||' |
- sort`
+
+case "$(git-rev-parse --no-revs)" in '') ;; *) usage ;; esac
+revs=$(git-rev-parse --revs-only --symbolic --no-flags "$@")
+flags=$(git-rev-parse --revs-only --flags "$@")
+case "$revs" in
+'')
+ revs=$(git-rev-parse --symbolic --all | sed -ne 's|^refs/heads/||p' |
+ sort)
shift ;;
esac
+set x $revs
+shift
hh= in=
for ref
@@ -22,7 +30,7 @@ do
*/"$ref") H='*' ;;
*) H='!' ;;
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" |
sed -e 's/^[^ ]* //'`
hh="$hh $h"
@@ -32,7 +40,7 @@ done
set x $hh
shift
-git-rev-list --pretty=oneline "$@" |
+git-rev-list --pretty=oneline $flags $@ |
while read v l
do
in=''