2 # TopGit - A different patch queue manager
3 # (c) Petr Baudis <pasky@suse.cz> 2008
20 echo "Usage: tg [...] summary [-t | --graphviz]" >&2
25 curname
="$(git symbolic-ref HEAD | sed 's#^refs/\(heads\|top-bases\)/##')"
27 if [ -n "$graphviz" ]; then
29 # GraphViz output; pipe to:
30 # | dot -Tpng -o <ouput>
38 label="TopGit Layout\n\n\n"
50 git for-each-ref refs
/top-bases |
51 while read rev type ref
; do
52 name
="${ref#refs/top-bases/}"
53 if [ -n "$terse" ]; then
57 if [ -n "$graphviz" ]; then
58 git cat-file blob
"$name:.topdeps" |
while read dep
; do
59 echo "\"$name\" -> \"$dep\";"
67 [ "$name" != "$curname" ] || current
='>'
69 ! branch_empty
"$name" || nonempty
='0'
71 [ -z "$base_remote" ] || remote
='l'
72 ! has_remote
"$name" || remote
='r'
74 [ "$remote" != 'r' ] ||
! ref_exists
"refs/remotes/$base_remote/top-bases/$name" ||
{
75 branch_contains
"refs/top-bases/$name" "refs/remotes/$base_remote/top-bases/$name" &&
76 branch_contains
"$name" "refs/remotes/$base_remote/$name"
78 [ "$rem_update" = 'R' ] || branch_contains
"refs/remotes/$base_remote/$name" "$name" 2>/dev
/null ||
81 needs_update
"$name" >/dev
/null || deps_update
='D'
83 [ -z "$missing_deps" ] || deps_missing
='!'
85 branch_contains
"$name" "refs/top-bases/$name" || base_update
='B'
87 if [ "$(git rev-parse "$name")" != "$rev" ]; then
88 subject
="$(git cat-file blob "$name:.topmsg
" | sed -n 's/^Subject: //p')"
91 subject
="(No commits)"
94 printf '%s\t%-31s\t%s\n' "$current$nonempty$remote$rem_update$deps_update$deps_missing$base_update" \
98 if [ -n "$graphviz" ]; then