chiark / gitweb /
tg.sh: Runtime tg-* command check
[topgit.git] / tg-create.sh
index 0db1cf376bdde093396a96cfd8df0eec8a96fd00..6cce7edebc1102bc9cfe86226f96ee40bc1ab8c0 100644 (file)
@@ -15,7 +15,7 @@ while [ -n "$1" ]; do
        arg="$1"; shift
        case "$arg" in
        -*)
-               echo "Usage: tg create [-d DEPS...] NAME" >&2
+               echo "Usage: tg create NAME [DEPS...]" >&2
                exit 1;;
        *)
                if [ -z "$name" ]; then
@@ -104,7 +104,11 @@ author="$(git var GIT_AUTHOR_IDENT)"
 author_addr="${author%> *}>"
 {
        echo "From: $author_addr"
-       echo "Subject: [PATCH] $1"
+       ! header="$(git config topgit.to)" || echo "To: $header"
+       ! header="$(git config topgit.cc)" || echo "Cc: $header"
+       ! header="$(git config topgit.bcc)" || echo "Bcc: $header"
+       ! subject_prefix="$(git config topgit.subjectprefix)" || subject_prefix="$subject_prefix "
+       echo "Subject: [${subject_prefix}PATCH] $name"
        echo
        cat <<EOT
 <patch description>