]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Meta/cook.sh: list topics that forked from others a bit more sensibly
authorJunio C Hamano <gitster@pobox.com>
Wed, 9 Dec 2009 23:36:39 +0000 (15:36 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 9 Dec 2009 23:36:39 +0000 (15:36 -0800)
cook.sh

diff --git a/cook.sh b/cook.sh
index 793b724ea917728db0c79fa0bb26df0d7cad08dd..ee717924aacf75df01a57feeb4a77948ebc181ed 100755 (executable)
--- a/cook.sh
+++ b/cook.sh
@@ -90,6 +90,9 @@ add_desc () {
        while :
        do
                other=$1
+               case "$other" in
+               "#EPO-"*) other="early parts of ${other#"#EPO-"}"
+               esac
                shift
                case "$#,$others" in
                0,)
@@ -125,11 +128,13 @@ show_topic () {
        fi
 }
 
+# List commits that are shared between more than one topic branches
 while read b
 do
        git rev-list --no-merges "master..$b"
 done <"$tmp.branches" | sort | uniq -d >"$tmp.shared"
 
+# Set of branches related to each other due to sharing the same commit
 while read shared
 do
        b=$(git branch --contains "$shared" | sed -n -e 's/^..//' -e '/\//p')
@@ -141,7 +146,7 @@ while read b
 do
        related=$(grep " $b " "$tmp.related" | tr ' ' '\012' | sort -u | sed -e '/^$/d')
 
-       based_on=
+       based_on= based_on_msg=
        used_by=
        forks=
        same_as=
@@ -158,12 +163,19 @@ do
                                ;;
                        0,*)
                                based_on="$based_on$r "
+                               based_on_msg="$based_on_msg$r "
                                ;;
                        *,0)
                                used_by="$used_by$r "
                                ;;
                        *,*)
-                               forks="$forks$r "
+                               if test $based -lt $bases
+                               then
+                                       based_on="$based_on$r "
+                                       based_on_msg="${based_on_msg}#EPO-$r "
+                               else
+                                       forks="$forks$r "
+                               fi
                                ;;
                        esac
                done
@@ -174,9 +186,9 @@ do
 
                description=
                test -z "$same_as" || add_desc 'is same as' $same_as
-               test -z "$based_on" || add_desc 'uses' $based_on
+               test -z "$based_on" || add_desc 'uses' $based_on_msg
                test -z "$used_by" || add_desc 'is used by' $used_by
-               test -z "$forks" || add_desc 'is related to' $forks
+               test -z "$forks" || add_desc 'shares commits with' $forks
 
                test -z "$description" ||
                echo " (this branch$description.)"