arg="$1"; shift
case "$arg" in
-*)
- echo "Usage: tg create NAME [DEPS...]" >&2
+ echo "Usage: tg [...] create NAME [DEPS...]" >&2
exit 1;;
*)
if [ -z "$name" ]; then
[ -n "$merge" -o -n "$restarted" ] || merge="$deps "
for d in $deps; do
- git rev-parse --verify "$d" >/dev/null 2>&1 ||
+ ref_exists "$d" ||
die "unknown branch dependency '$d'"
done
-! git rev-parse --verify "$name" >/dev/null 2>&1 ||
+! ref_exists "$name" ||
die "branch '$name' already exists"
# Clean up any stale stuff
info "Merging $name base with $branch..."
if ! git merge "$branch"; then
- info "Please commit merge resolution and call: tg create"
+ info "Please commit merge resolution and call: $tg create"
info "It is also safe to abort this operation using:"
info "git reset --hard some_branch"
info "(You are on a detached HEAD now.)"
info "Topic branch $name set up. Please fill .topmsg now and make initial commit."
-info "To abort: git rm -f .top* && git checkout ${deps%% *} && tg delete $name"
+info "To abort: git rm -f .top* && git checkout ${deps%% *} && $tg delete $name"