From: Mike Frysinger Date: Thu, 21 May 2009 21:29:09 +0000 (-0400) Subject: add an auto flag to send e-mail for me X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=bdf10c38d6691842eda9e43b62413def106fa950;p=home.git add an auto flag to send e-mail for me --- 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}