[PATCH] Support packs in local-pull
[git.git] / git-show-branches-script
blob263025c476a2e243d568c2709773381fd1c179ed
1 #!/bin/sh
3 # Show refs and their recent commits.
6 . git-sh-setup-script || die "Not a git repository"
8 headref=`readlink $GIT_DIR/HEAD`
9 case "$#" in
11 set x `cd $GIT_DIR/refs &&
12 find heads -type f -print |
13 sed -e 's|heads/||' |
14 sort`
15 shift ;;
16 esac
18 hh= in=
19 for ref
21 case "/$headref" in
22 */"$ref") H='*' ;;
23 *) H='!' ;;
24 esac
25 h=`git-rev-parse --verify "$ref^0"` || exit
26 l=`git-log-script --max-count=1 --pretty=oneline "$h" |
27 sed -e 's/^[^ ]* //'`
28 hh="$hh $h"
29 echo "$in$H [$ref] $l"
30 in="$in "
31 done
32 set x $hh
33 shift
35 git-rev-list --pretty=oneline "$@" |
36 while read v l
38 in=''
39 for h
41 b=`git-merge-base $h $v`
42 case "$b" in
43 $v) in="$in+" ;;
44 *) in="$in " ;;
45 esac
46 done
48 echo "$in $l"
49 case "$in" in
50 *' '*) ;;
51 *) break ;;
52 esac
53 done