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-create.sh: fix help string
[topgit.git]
/
tg-create.sh
diff --git
a/tg-create.sh
b/tg-create.sh
index b5c7789315b6d6448b407ab2370013ebbd34a62c..5438debd0821b1d78e81e7f84d107482e689ca06 100644
(file)
--- a/
tg-create.sh
+++ b/
tg-create.sh
@@
-14,28
+14,30
@@
name=
while [ -n "$1" ]; do
arg="$1"; shift
case "$arg" in
while [ -n "$1" ]; do
arg="$1"; shift
case "$arg" in
- -d)
- deps="$(echo "$1" | sed 's/,/ /g')"; shift;;
-*)
-*)
- echo "Usage: tg create
[-d DEPS...] NAME
" >&2
+ echo "Usage: tg create
NAME [DEPS...]
" >&2
exit 1;;
*)
exit 1;;
*)
- [ -z "$name" ] || die "name already specified ($name)"
- name="$arg";;
+ if [ -z "$name" ]; then
+ name="$arg"
+ else
+ deps="$deps $arg"
+ fi;;
esac
done
## Auto-guess dependencies
esac
done
## Auto-guess dependencies
+deps="${deps# }"
if [ -z "$deps" ]; then
head="$(git symbolic-ref HEAD)"
if [ -z "$deps" ]; then
head="$(git symbolic-ref HEAD)"
- bname="${head
s
#refs/top-bases/}"
+ bname="${head#refs/top-bases/}"
if [ "$bname" != "$head" -a -s "$git_dir/top-deps" -a -s "$git_dir/top-merge" ]; then
# We are on a base branch now; resume merge!
deps="$(cat "$git_dir/top-deps")"
if [ "$bname" != "$head" -a -s "$git_dir/top-deps" -a -s "$git_dir/top-merge" ]; then
# We are on a base branch now; resume merge!
deps="$(cat "$git_dir/top-deps")"
- merge="$(cat "$git_dir/top-merge")
"
- name="$b
as
e"
+ merge="$(cat "$git_dir/top-merge")"
+ name="$b
nam
e"
restarted=1
info "Resuming $name setup..."
else
restarted=1
info "Resuming $name setup..."
else
@@
-102,6
+104,9
@@
author="$(git var GIT_AUTHOR_IDENT)"
author_addr="${author%> *}>"
{
echo "From: $author_addr"
author_addr="${author%> *}>"
{
echo "From: $author_addr"
+ ! header="$(git config topgit.to)" || echo "To: $header"
+ ! header="$(git config topgit.cc)" || echo "Cc: $header"
+ ! header="$(git config topgit.bcc)" || echo "Bcc: $header"
echo "Subject: [PATCH] $1"
echo
cat <<EOT
echo "Subject: [PATCH] $1"
echo
cat <<EOT
@@
-114,5
+119,5
@@
git add "$root_dir/.topmsg"
-info "Topic branch $name s
uccessfully set up. Please fill .topmsg now
."
-info "
You MUST do an initial commit.
To abort: git rm -f .top* && git checkout ${deps%% *} && tg delete $name"
+info "Topic branch $name s
et up. Please fill .topmsg now and make initial commit
."
+info "To abort: git rm -f .top* && git checkout ${deps%% *} && tg delete $name"