summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 30b96fc)
raw | patch | inline | side by side (parent: 30b96fc)
author | Junio C Hamano <junkio@cox.net> | |
Tue, 16 Aug 2005 20:01:39 +0000 (13:01 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 17 Aug 2005 19:11:36 +0000 (12:11 -0700) |
This lets you say "git show-branches --max-count=30".
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-show-branches-script | patch | blob | history |
index 263025c476a2e243d568c2709773381fd1c179ed..90018a9e88d7a5ec607fb6530449c0a56cca52ac 100755 (executable)
--- a/git-show-branches-script
+++ b/git-show-branches-script
. 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
*/"$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"
set x $hh
shift
-git-rev-list --pretty=oneline "$@" |
+git-rev-list --pretty=oneline $flags $@ |
while read v l
do
in=''