summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
706fd50)
Inspired by Antonio Ospite <ospite@studenti.unina.it>'s tg-graphviz.sh.
This can take long time to accurately determine all the relevant
information about each branch; you can pass '-t' to get just
This can take long time to accurately determine all the relevant
information about each branch; you can pass '-t' to get just
- terse list of topic branch names quickly.
+ terse list of topic branch names quickly. Alternately, you can
+ pass '--graphviz' to get a dot-suitable output to draw a dependency
+ graph between the topic branches.
TODO: Speed up by an order of magnitude
TODO: Speed up by an order of magnitude
case "$arg" in
-t)
terse=1;;
case "$arg" in
-t)
terse=1;;
+ --graphviz)
+ graphviz=1;;
- echo "Usage: tg [...] summary [-t]" >&2
+ echo "Usage: tg [...] summary [-t | --graphviz]" >&2
exit 1;;
esac
done
curname="$(git symbolic-ref HEAD | sed 's#^refs/\(heads\|top-bases\)/##')"
exit 1;;
esac
done
curname="$(git symbolic-ref HEAD | sed 's#^refs/\(heads\|top-bases\)/##')"
+if [ -n "$graphviz" ]; then
+ cat <<EOT
+# GraphViz output; pipe to:
+# | dot -Tpng -o <ouput>
+# or
+# | dot -Txlib
+
+digraph G {
+
+graph [
+ rankdir = "TB"
+ label="TopGit Layout\n\n\n"
+ fontsize = 14
+ labelloc=top
+ pad = "0.5,0.5"
+];
+
+EOT
+fi
+
+ if [ -n "$graphviz" ]; then
+ git cat-file blob "$name:.topdeps" | while read dep; do
+ echo "\"$name\" -> \"$dep\";"
+ done
+ continue
+ fi
printf '%s\t%-31s\t%s\n' "$current$nonempty$remote$rem_update$deps_update$deps_missing$base_update" \
"$name" "$subject"
done
printf '%s\t%-31s\t%s\n' "$current$nonempty$remote$rem_update$deps_update$deps_missing$base_update" \
"$name" "$subject"
done
+
+if [ -n "$graphviz" ]; then
+ echo '}'
+fi