10 ignore_file
=${1#*=} ;;
22 describe
=$
(git describe
"master")
23 base
=$
(expr "$describe" : '\(.*\)-\([0-9]*\)-g[0-9a-f]*$') ||
26 git rev-parse
--verify "$base^0" >/dev
/null
2>/dev
/null ||
{
27 echo >&2 "Eh? where is your base?"
32 topics
= leftover
= dothis
=
37 if test -f "$ignore_file"
39 while read ignore rest
42 if ignore
=$
(git rev-parse
-q --verify $ignore)
45 elif ignore
=$
(expr "$rest" : '.* \([0-9a-f]\{40\}\)$')
51 ignores
="$ignores$ignore "
56 leftover
="$leftover$1$LF"
60 dothis
="$1$LF$LF$dothis"
64 topic
="$2" tip
="$3" date="$4" merged
="$1"
65 case " $topics" in *" $topic "*) return ;; esac
66 topics
="$topics$topic "
68 contam_count
=$
(git rev-list
"maint..$tip" |
grep -F "$merges_to_master" |
wc -l)
69 if test "$contam_count" != 0
71 echo "**** forked from master $topic ****"
75 maint_count
=$
(git rev-list
"maint..$tip" |
wc -l)
76 if test "$maint_count" = 0
78 echo "**** already merged $topic ****"
79 return ;# already merged
84 master_count
=$
(git rev-list
"$base..$tip" |
wc -l)
85 if test $maint_count -le $master_count
92 if current
=$
(git rev-parse
--verify -q "$topic^0") &&
93 test "$current" = "$tip"
97 elif test -z "$current"
103 case "$mergeable,$ready" in
105 comment
="# $topic: not mergeable ($master_count vs $maint_count)"
106 comment
="$comment$LF# $merged"
110 topic_count
=$
(git rev-list
"$base..$current" |
wc -l)
112 comment
="# $topic: not ready ($master_count vs $topic_count)"
113 comment
="$comment$LF# $merged"
118 if test $maint_count = $master_count
120 insn
="$insn # $master_count ($date) $merged"
122 insn
="$insn # $maint_count/$master_count ($date) $merged"
124 insn
="$insn$LF$(git log --oneline "maint..
$tip" | sed -e "s
/^
/# /")"
130 merges_to_master
="$(git rev-list --merges $base..master)"
132 git log
--first-parent --min-parents=2 --max-parents=2 \
133 --format='%ci %H %P %s' "$base..master" |
{
134 while read date time zone commit parent tip subject
136 case " $ignores" in *" $commit "*) continue ;; esac
137 topic
=$
(expr "$subject" : "Merge branch '\(.*\)'$") ||
{
138 defer
"# ignoring $commit ($subject)"
141 one_topic
"$commit" "$topic" "$tip" "$date"