2 # TopGit - A different patch queue manager
3 # (c) Petr Baudis <pasky@suse.cz> 2008
10 echo "Usage: tg [...] summary" >&2
14 curname
="$(git symbolic-ref HEAD | sed 's#^refs/\(heads\|top-bases\)/##')"
19 git for-each-ref refs
/top-bases |
20 while read rev type ref
; do
21 name
="${ref#refs/top-bases/}"
25 [ "$name" != "$curname" ] || current
='>'
27 ! branch_empty
"$name" || nonempty
='0'
29 [ -z "$base_remote" ] || remote
='l'
30 ! has_remote
"$name" || remote
='r'
32 [ "$remote" != 'r' ] ||
! ref_exists
"refs/remotes/$base_remote/top-bases/$name" ||
{
33 branch_contains
"refs/top-bases/$name" "refs/remotes/$base_remote/top-bases/$name" &&
34 branch_contains
"$name" "refs/remotes/$base_remote/$name"
36 [ "$rem_update" = 'R' ] || branch_contains
"refs/remotes/$base_remote/$name" "$name" 2>/dev
/null ||
39 needs_update
"$name" >/dev
/null || deps_update
='D'
41 [ -z "$missing_deps" ] || deps_missing
='!'
43 branch_contains
"$name" "refs/top-bases/$name" || base_update
='B'
45 if [ "$(git rev-parse "$name")" != "$rev" ]; then
46 subject
="$(git cat-file blob "$name:.topmsg
" | sed -n 's/^Subject: //p')"
49 subject
="(No commits)"
52 printf '%s\t%-31s\t%s\n' "$current$nonempty$remote$rem_update$deps_update$deps_missing$base_update" \