2 # TopGit - A different patch queue manager
3 # (c) Petr Baudis <pasky@suse.cz> 2008
11 subcmd
="$1"; shift ||
:
14 echo "Usage: tg [...] depend add NAME" >&2
19 die
"unknown subcommand ($subcmd)";;
26 echo "Usage: tg [...] depend add NAME" >&2
29 [ -z "$name" ] || die
"name already specified ($name)"
37 [ -n "$name" ] || die
"no branch name specified"
38 branchrev
="$(git rev-parse --verify "$name" 2>/dev/null)" ||
39 die
"invalid branch name: $name"
40 baserev
="$(git rev-parse --verify "refs
/top-bases
/$name" 2>/dev/null)" ||
41 die
"not a TopGit topic branch: $name"
44 ## Record new dependency
46 echo "$name" >>.topdeps
48 git commit
-m"New TopGit dependency: $name"