From patchwork Fri May 13 23:38:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [RFC,10/10] send-pull-request: verify git sendemail config Date: Fri, 13 May 2011 23:38:24 -0000 From: Darren Hart X-Patchwork-Id: 4017 Message-Id: <33b417d1457fc40c41c4957d62e6758ec1cfcc42.1305329659.git.dvhart@linux.intel.com> To: openembedded-core@lists.openembedded.org Perform a quick sanity check to be able to direct users to configure git.sendemail if they haven't yet. Signed-off-by: Darren Hart --- scripts/send-pull-request | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/scripts/send-pull-request b/scripts/send-pull-request index f94596f..2ccb8e8 100755 --- a/scripts/send-pull-request +++ b/scripts/send-pull-request @@ -38,6 +38,18 @@ harvest_recipients() unset IFS } +check_git_sendemail_config() +{ + GIT_SMTP=$(git config sendemail.smtpserver) + GIT_FROM=$(git config sendemail.from) + if [ -z "$GIT_SMTP" ] || [ -z "$GIT_FROM" ]; then + echo "ERROR: git sendemail is not configured." + echo "Please read GIT-SEND-EMAIL(1) and configure:" + echo " sendemail.smtpserver" + echo " sendemail.from" + exit 1 + fi +} # Parse and verify arguments while getopts "ahp:t:" OPT; do @@ -67,6 +79,9 @@ while getopts "ahp:t:" OPT; do esac done +# Abort early if git-send-email is not properly configured +check_git_sendemail_config + if [ -z "$PDIR" ]; then echo "ERROR: you must specify a pull-dir." usage