chiark
/
gitweb
/
~ian
/
topgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tg summary: Mark current branch with '>'
[topgit.git]
/
tg-summary.sh
diff --git
a/tg-summary.sh
b/tg-summary.sh
index 8616d074dc6f392f9ec1df1533339bfa6ffdc021..bb71971aad2055c2d7d8388e59b4091dd9650256 100644
(file)
--- a/
tg-summary.sh
+++ b/
tg-summary.sh
@@
-11,6
+11,8
@@
if [ -n "$1" ]; then
exit 1
fi
exit 1
fi
+curname="$(git symbolic-ref HEAD | sed 's#^refs/\(heads\|top-bases\)/##')"
+
## List branches
## List branches
@@
-19,6
+21,8
@@
git for-each-ref refs/top-bases |
name="${ref#refs/top-bases/}"
missing_deps=
name="${ref#refs/top-bases/}"
missing_deps=
+ current=' '
+ [ "$name" != "$curname" ] || current='>'
nonempty=' '
! branch_empty "$name" || nonempty='0'
remote=' '
nonempty=' '
! branch_empty "$name" || nonempty='0'
remote=' '
@@
-45,6
+49,6
@@
git for-each-ref refs/top-bases |
subject="(No commits)"
fi
subject="(No commits)"
fi
- printf '%s\t%-31s\t%s\n' "$nonempty$remote$rem_update$deps_update$deps_missing$base_update" \
+ printf '%s\t%-31s\t%s\n' "$
current$
nonempty$remote$rem_update$deps_update$deps_missing$base_update" \
"$name" "$subject"
done
"$name" "$subject"
done