From: Petr Baudis Date: Fri, 3 Oct 2008 15:22:56 +0000 (+0200) Subject: tg mail -r MSGID: Generate In-reply-to header X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=topgit.git;a=commitdiff_plain;h=fde494fdb3a1606f68a410e789e4f930a68b5df0 tg mail -r MSGID: Generate In-reply-to header --- diff --git a/README b/README index 35a9f98..2c94dc6 100644 --- a/README +++ b/README @@ -298,6 +298,8 @@ tg mail its documentation for details on how to setup email for git. You can pass arbitrary options to this command through the '-s' parameter, but you must double-quote everything. + The '-r' parameter with msgid can be used to generate in-reply-to + and reference headers to an earlier mail. TODO: 'tg mail patchfile' to mail an already exported patch TODO: mailing patch series diff --git a/tg-mail.sh b/tg-mail.sh index fb686e9..dd50004 100644 --- a/tg-mail.sh +++ b/tg-mail.sh @@ -4,6 +4,7 @@ name= send_email_args= +in_reply_to= ## Parse options @@ -13,8 +14,10 @@ while [ -n "$1" ]; do 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)" @@ -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" +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)"