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
9 USAGE
="Usage: ${tgname:-tg} [...] base [--short[=n] | --no-short] [--] [branch...]"
13 if [ "${1:-0}" != 0 ]; then
14 printf '%s\n' "$USAGE" >&2
16 printf '%s\n' "$USAGE"
25 while [ $# -gt 0 ]; do case "$1" in
28 --short|
--short=*|
--no-short)
34 die
"unrecognized option: $1";;
39 if [ "$#" -eq 0 ]; then
45 [ "$rev" != "@" ] ||
rev="HEAD"
46 name
="$(strip_ref "$
(git symbolic-ref
-q "$rev" 2>/dev
/null || echol
"$rev")")"
47 git rev-parse
--verify $short "refs/$topbases/$name" -- 2>/dev
/null ||
{
49 echo "$rev is not a TopGit branch" >&2