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 mail -r MSGID: Generate In-reply-to header
[topgit.git]
/
tg-mail.sh
diff --git
a/tg-mail.sh
b/tg-mail.sh
index fb686e945a457e08ed00e16a78f40792a2a99443..dd50004a96127f9b6a26a93d1c47503c8aa1882d 100644
(file)
--- a/
tg-mail.sh
+++ b/
tg-mail.sh
@@
-4,6
+4,7
@@
name=
send_email_args=
name=
send_email_args=
+in_reply_to=
## Parse options
## Parse options
@@
-13,8
+14,10
@@
while [ -n "$1" ]; do
case "$arg" in
-s)
send_email_args="$1"; shift;;
case "$arg" in
-s)
send_email_args="$1"; shift;;
+ -r)
+ in_reply_to="$1"; shift;;
-*)
-*)
- echo "Usage: tg [...] mail [-s SEND_EMAIL_ARGS] [NAME]" >&2
+ echo "Usage: tg [...] mail [-s SEND_EMAIL_ARGS] [
-r REFERENCE_MSGID] [
NAME]" >&2
exit 1;;
*)
[ -z "$name" ] || die "name already specified ($name)"
exit 1;;
*)
[ -z "$name" ] || die "name already specified ($name)"
@@
-26,6
+29,10
@@
done
base_rev="$(git rev-parse --short --verify "refs/top-bases/$name" 2>/dev/null)" ||
die "not a TopGit-controlled branch"
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
+ send_email_args="$send_email_args --in-reply-to=$in_reply_to"
+fi
+
patchfile="$(mktemp -t tg-mail.XXXXXX)"
patchfile="$(mktemp -t tg-mail.XXXXXX)"