chiark
/
gitweb
/
~ian
/
topgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update upstream tarball building steps
[topgit.git]
/
tg-mail.sh
diff --git
a/tg-mail.sh
b/tg-mail.sh
index cf68155565f8ab90945704489f92850a639e8831..24e5f67b2742b8edf6fd6213f58d6546a27e013c 100644
(file)
--- a/
tg-mail.sh
+++ b/
tg-mail.sh
@@
-3,6
+3,7
@@
# GPLv2
name=
# GPLv2
name=
+send_email_args=
## Parse options
## Parse options
@@
-10,8
+11,10
@@
name=
while [ -n "$1" ]; do
arg="$1"; shift
case "$arg" in
while [ -n "$1" ]; do
arg="$1"; shift
case "$arg" in
+ -s)
+ send_email_args="$1"; shift;;
-*)
-*)
- echo "Usage: tg [...] mail [NAME]" >&2
+ echo "Usage: tg [...] mail [
-s SEND_EMAIL_ARGS] [
NAME]" >&2
exit 1;;
*)
[ -z "$name" ] || die "name already specified ($name)"
exit 1;;
*)
[ -z "$name" ] || die "name already specified ($name)"
@@
-37,16
+40,14
@@
from="$(echo "$header" | grep '^From:' | sed 's/From:\s*//')"
to="$(echo "$header" | grep '^To:' | sed 's/To:\s*//')"
to="$(echo "$header" | grep '^To:' | sed 's/To:\s*//')"
-# XXX I can't get quoting right without arrays
-[ -n "$from" ] && from=(--from "$from")
-[ -n "$to" ] && to=(--to "$to") # FIXME there could be multimple To
-
+# XXX: I can't get quoting right without arrays
people=()
people=()
-[ -n "$from" ] && people=("${people[@]}" "${from[@]}")
-[ -n "$to" ] && people=("${people[@]}" "${to[@]}")
+[ -n "$from" ] && people=("${people[@]}" --from "$from")
+# FIXME: there could be multimple To
+[ -n "$to" ] && people=("${people[@]}" --to "$to")
-# NOTE git-send-email handles cc itself
-git send-email "${people[@]}" "$patchfile"
+# NOTE
:
git-send-email handles cc itself
+git send-email
$send_email_args
"${people[@]}" "$patchfile"
rm "$patchfile"
rm "$patchfile"