chiark
/
gitweb
/
~ian
/
topgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refactor tg summary
[topgit.git]
/
tg-mail.sh
diff --git
a/tg-mail.sh
b/tg-mail.sh
index dd50004a96127f9b6a26a93d1c47503c8aa1882d..8167adecb7421d6750205bd9304243f587a2e4d4 100644
(file)
--- a/
tg-mail.sh
+++ b/
tg-mail.sh
@@
-30,7
+30,7
@@
base_rev="$(git rev-parse --short --verify "refs/top-bases/$name" 2>/dev/null)"
die "not a TopGit-controlled branch"
if [ -n "$in_reply_to" ]; then
die "not a TopGit-controlled branch"
if [ -n "$in_reply_to" ]; then
- send_email_args="$send_email_args --in-reply-to=
$in_reply_to
"
+ send_email_args="$send_email_args --in-reply-to=
'$in_reply_to'
"
fi
fi
@@
-38,7
+38,7
@@
patchfile="$(mktemp -t tg-mail.XXXXXX)"
$tg patch "$name" >"$patchfile"
$tg patch "$name" >"$patchfile"
-header="$(sed -e '/^$/,$d' "$patchfile")"
+header="$(sed -e '/^$/,$d'
-e "s,','\\\\'',g"
"$patchfile")"
@@
-46,14
+46,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
-people=()
-[ -n "$from" ] && people=("${people[@]}" --from "$from")
+people=
+[ -n "$from" ] && people="$people --from '$from'"
# FIXME: there could be multimple To
# FIXME: there could be multimple To
-[ -n "$to" ] && people=("${people[@]}" --to "$to")
-
+[ -n "$to" ] && people="$people --to '$to'"
# NOTE: git-send-email handles cc itself
# NOTE: git-send-email handles cc itself
-
git send-email $send_email_args "${people[@]}
" "$patchfile"
+
eval git send-email $send_email_args "$people
" "$patchfile"
rm "$patchfile"
rm "$patchfile"
+
+# vim:noet