chiark / gitweb /
Merge branch 'master' into refs/top-bases/debian/locations
[topgit.git] / tg-summary.sh
index 3c90a6b5952e526bac9da80e84386d6abf6246a8..50ee8832090c6646c9bd114d6f5926657dcc07db 100644 (file)
@@ -24,6 +24,9 @@ done
 
 curname="$(git symbolic-ref HEAD | sed 's#^refs/\(heads\|top-bases\)/##')"
 
+! [ -n "$terse" -a -n "$graphviz" ] ||
+       die "-t and --graphviz options are mutual exclusive"
+
 if [ -n "$graphviz" ]; then
        cat <<EOT
 # GraphViz output; pipe to:
@@ -50,13 +53,22 @@ fi
 git for-each-ref refs/top-bases |
        while read rev type ref; do
                name="${ref#refs/top-bases/}"
+               if branch_annihilated "$name"; then
+                       continue;
+               fi;
+
                if [ -n "$terse" ]; then
                        echo "$name"
                        continue
                fi
                if [ -n "$graphviz" ]; then
                        git cat-file blob "$name:.topdeps" | while read dep; do
-                               echo "\"$name\" -> \"$dep\";"
+                               dep_is_tgish=true
+                               ref_exists "refs/top-bases/$dep"  ||
+                                       dep_is_tgish=false
+                               if ! "$dep_is_tgish" || ! branch_annihilated $dep; then
+                                       echo "\"$name\" -> \"$dep\";"
+                               fi
                        done
                        continue
                fi
@@ -98,3 +110,5 @@ git for-each-ref refs/top-bases |
 if [ -n "$graphviz" ]; then
        echo '}'
 fi
+
+# vim:noet