2 # TopGit - A different patch queue manager
3 # (C) Petr Baudis <pasky@suse.cz> 2008
4 # (C) Per Cederqvist <ceder@lysator.liu.se> 2010
5 # (C) Kyle J. McKay <mackyle@gmail.com> 2017, 2021
10 Usage: ${tgname:-tg} [...] base [--short[=<n>] | --no-short] [--] [branch...]
12 --short[=<n>] display shortened hashes (default)
13 --no-short display full hashes"
17 if [ "${1:-0}" != 0 ]; then
18 printf '%s\n' "$USAGE" >&2
20 printf '%s\n' "$USAGE"
29 while [ $# -gt 0 ]; do case "$1" in
32 --short|
--short=*|
--no-short)
38 die
"unrecognized option: $1";;
43 if [ "$#" -eq 0 ]; then
49 [ "$rev" != "@" ] ||
rev="HEAD"
50 name
="$(git symbolic-ref -q "$rev" 2>/dev/null)" || name
="$rev"
51 v_strip_ref name
"$name"
52 git rev-parse
--verify $short "refs/$topbases/$name^0" -- 2>/dev
/null ||
{
54 echo "$rev is not a TopGit branch" >&2