From patchwork Wed Mar 16 03:53:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [v2, 1/1] send-pull-request: Fetch TO email address from git config if specified Date: Wed, 16 Mar 2011 03:53:28 -0000 From: Khem Raj X-Patchwork-Id: 1423 Message-Id: <25530fcd5ccb232f0236a03d8fcd45167fa8488e.1300247367.git.raj.khem@gmail.com> To: OE core Usually people using git send-email has git config sendmail.to configured to the usual mailing list or person so we harness that here. Signed-off-by: Khem Raj Acked-by: Darren Hart --- scripts/send-pull-request | 21 +++++++++++++++------ 1 files changed, 15 insertions(+), 6 deletions(-) diff --git a/scripts/send-pull-request b/scripts/send-pull-request index 7f51a1b..3af2a9f 100755 --- a/scripts/send-pull-request +++ b/scripts/send-pull-request @@ -109,15 +109,17 @@ if [ $AUTO -eq 1 ]; then harvest_recipients CC "^.*-[Bb][Yy]: *" fi -if [ -z "$TO" ] && [ -z "$CC" ]; then - echo "ERROR: you have not specified any recipients." - usage - exit 1 -fi - case "$PULL_MTA" in git) FROM="$(git config sendemail.from)" + AUTO_TO="$(git config sendemail.to)" + if [ -n "$AUTO_TO" ]; then + if [ -n "$TO" ]; then + TO="$TO,$AUTO_TO" + else + TO="$AUTO_TO" + fi + fi ;; sendmail) if [ -z "$FROM" ]; then @@ -131,6 +133,13 @@ case "$PULL_MTA" in ;; esac +if [ -z "$TO" ] && [ -z "$CC" ]; then + echo "ERROR: you have not specified any recipients." + usage + exit 1 +fi + + # Generate report for the user and require confirmation before sending cat <