2005-08-15 10:42:15 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Show refs and their recent commits.
|
|
|
|
#
|
|
|
|
|
|
|
|
. git-sh-setup-script || die "Not a git repository"
|
|
|
|
|
2005-08-16 22:01:39 +02:00
|
|
|
usage () {
|
|
|
|
die "usage: $0 <ref>..."
|
|
|
|
}
|
|
|
|
|
2005-08-15 10:42:15 +02:00
|
|
|
headref=`readlink $GIT_DIR/HEAD`
|
2005-08-16 22:01:39 +02:00
|
|
|
|
|
|
|
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)
|
2005-08-15 10:42:15 +02:00
|
|
|
shift ;;
|
|
|
|
esac
|
2005-08-16 22:01:39 +02:00
|
|
|
set x $revs
|
|
|
|
shift
|
2005-08-15 10:42:15 +02:00
|
|
|
|
|
|
|
hh= in=
|
|
|
|
for ref
|
|
|
|
do
|
|
|
|
case "/$headref" in
|
|
|
|
*/"$ref") H='*' ;;
|
|
|
|
*) H='!' ;;
|
|
|
|
esac
|
2005-08-16 22:01:39 +02:00
|
|
|
h=`git-rev-parse --verify "$ref^0" 2>/dev/null` || continue
|
2005-08-15 10:42:15 +02:00
|
|
|
l=`git-log-script --max-count=1 --pretty=oneline "$h" |
|
|
|
|
sed -e 's/^[^ ]* //'`
|
|
|
|
hh="$hh $h"
|
|
|
|
echo "$in$H [$ref] $l"
|
|
|
|
in="$in "
|
|
|
|
done
|
|
|
|
set x $hh
|
|
|
|
shift
|
|
|
|
|
2005-08-16 22:01:39 +02:00
|
|
|
git-rev-list --pretty=oneline $flags $@ |
|
2005-08-15 10:42:15 +02:00
|
|
|
while read v l
|
|
|
|
do
|
|
|
|
in=''
|
|
|
|
for h
|
|
|
|
do
|
|
|
|
b=`git-merge-base $h $v`
|
|
|
|
case "$b" in
|
|
|
|
$v) in="$in+" ;;
|
|
|
|
*) in="$in " ;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "$in $l"
|
|
|
|
case "$in" in
|
|
|
|
*' '*) ;;
|
|
|
|
*) break ;;
|
|
|
|
esac
|
|
|
|
done
|