From: Petr Baudis Date: Wed, 24 Sep 2008 23:33:24 +0000 (+0200) Subject: tg mail -s SEND_EMAIL_ARGS: Pass arguments to git send-email X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=topgit.git;a=commitdiff_plain;h=ff2a44e9b68cfbc5f970bd07bad252607dd8179a tg mail -s SEND_EMAIL_ARGS: Pass arguments to git send-email --- diff --git a/README b/README index 7b117b8..03eeec5 100644 --- a/README +++ b/README @@ -296,6 +296,8 @@ tg mail Since it actually boils down to `git send-email` please refer to 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. 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 7e394b8..24e5f67 100644 --- a/tg-mail.sh +++ b/tg-mail.sh @@ -3,6 +3,7 @@ # GPLv2 name= +send_email_args= ## Parse options @@ -10,8 +11,10 @@ name= 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)" @@ -45,6 +48,6 @@ people=() # NOTE: git-send-email handles cc itself -git send-email "${people[@]}" "$patchfile" +git send-email $send_email_args "${people[@]}" "$patchfile" rm "$patchfile"