From bdf10c38d6691842eda9e43b62413def106fa950 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 21 May 2009 17:29:09 -0400 Subject: [PATCH] add an auto flag to send e-mail for me --- .bin/git-format-request-pull | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.bin/git-format-request-pull b/.bin/git-format-request-pull index 7c4f3a6..9845b00 100755 --- a/.bin/git-format-request-pull +++ b/.bin/git-format-request-pull @@ -5,9 +5,11 @@ usage() { exit ${1:-0} } +auto=false while [[ -n $1 ]] ; do case $1 in -h|--help) usage;; + -e) auto=true;; --) shift; break;; -*) usage 1;; *) break; @@ -25,14 +27,21 @@ fi name=$(git config --get user.name) email=$(git config --get user.email) -cat << EOF +tmp=$(mktemp) +cat << EOF > ${tmp} From: ${name} <${email}> Date: $(date -R) Subject: Pull request ${url##*/} $(git request-pull ${commit} ${url} ${branch}) EOF +cat ${tmp} -echo git send-email \ - --to \"$(git config --get sendemail.pullrequest)\" \ - --cc \"$(git config --get sendemail.to)\" ... 1>&2 +to=$(git config --get sendemail.pullrequest) +cc=$(git config --get sendemail.to) +if ${auto} ; then + git send-email --to "${to}" --cc "${cc}" ${tmp} +else + echo git send-email --to \"${to}\" --cc \"${cc}\" ... 1>&2 +fi +rm -f ${tmp} -- 2.39.5