tg-patch.sh: Bring deplist format in sync with tg info
[topgit/greenrd.git] / tg-summary.sh
blob55e9764001ea23c82f38eb0f3f1f1813cdedbf0a
1 #!/bin/sh
2 # TopGit - A different patch queue manager
3 # (c) Petr Baudis <pasky@suse.cz> 2008
4 # GPLv2
7 ## Parse options
9 if [ -n "$1" ]; then
10 echo "Usage: tg summary" >&2
11 exit 1
15 ## List branches
17 git for-each-ref refs/top-bases |
18 while read rev name ref; do
19 name="${ref#refs/top-bases/}"
21 nonempty=
22 ! branch_empty "$name" || nonempty='0'
23 deps_update=' '
24 [ -z "$(needs_update "$name")" ] || deps_update='D'
25 base_update=' '
26 branch_contains "$name" "refs/top-bases/$name" || base_update='B'
28 if [ "$(git rev-parse "$name")" != "$rev" ]; then
29 subject="$(git cat-file blob "$name:.topmsg" | sed -n 's/^Subject: //p')"
30 else
31 # No commits yet
32 subject="(No commits)"
35 printf '%s%s%s\t%-31s\t%s\n' "$nonempty" "$deps_update" "$base_update" \
36 "$name" "$subject"
37 done