Force adding the .topmsg and .topdep files.
[topgit/kirr.git] / tg-summary.sh
blob3905a8fab0207e9b3908e57d90e494f109b5efa1
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/}"
20 missing_deps=
22 nonempty=' '
23 ! branch_empty "$name" || nonempty='0'
24 deps_update=' '
25 needs_update "$name" >/dev/null || deps_update='D'
26 deps_missing=' '
27 [ -z "$missing_deps" ] || deps_missing='!'
28 base_update=' '
29 branch_contains "$name" "refs/top-bases/$name" || base_update='B'
31 if [ "$(git rev-parse "$name")" != "$rev" ]; then
32 subject="$(git cat-file blob "$name:.topmsg" | sed -n 's/^Subject: //p')"
33 else
34 # No commits yet
35 subject="(No commits)"
38 printf '%s\t%-31s\t%s\n' "$nonempty$deps_update$deps_missing$base_update" \
39 "$name" "$subject"
40 done