20 describe
=$
(git describe
"master")
21 base
=$
(expr "$describe" : '\(.*\)-\([0-9]*\)-g[0-9a-f]*$') ||
24 git rev-parse
--verify "$base^0" >/dev
/null
2>/dev
/null ||
{
25 echo >&2 "Eh? where is your base?"
37 leftover
="$leftover$1$LF"
41 dothis
="$1$LF$LF$dothis"
45 topic
="$1" tip
="$2" date="$3"
46 case " $topics" in *" $topic "*) return ;; esac
47 topics
="$topics$topic "
49 mergeable
=no ready
=no label
=
51 maint_count
=$
(git rev-list
"maint..$tip" |
wc -l)
52 if test "$maint_count" = 0
54 return ;# already merged
56 master_count
=$
(git rev-list
"$base..$tip" |
wc -l)
58 test $master_count = $maint_count && mergeable
=yes
60 if current
=$
(git rev-parse
--verify -q "$topic^0") &&
61 test "$current" = "$tip"
65 elif test -z "$current"
71 case "$mergeable,$ready" in
73 defer
"# $topic: not mergeable ($master_count vs $maint_count)"
76 topic_count
=$
(git rev-list
"$base..$current" |
wc -l)
77 defer
"# $topic: not ready ($master_count vs $topic_count)"
80 insn
="$label # $master_count ($date)"
81 insn
="$insn$LF$(git log --oneline "maint..
$tip" | sed -e "s
/^
/# /")"
87 git log
--first-parent --min-parents=2 --max-parents=2 \
88 --format='%ci %H %P %s' "$base..master" |
{
89 while read date time zone commit parent tip subject
91 topic
=$
(expr "$subject" : "Merge branch '\(.*\)'$") ||
{
92 echo >&2 "Cannot parse $commit ($subject)"
95 one_topic
"$topic" "$tip" "$date"