summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2011-05-13 15:42:37 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-05-19 23:37:53 +0100
commit95185de6f149a495201701d260921339e3dfaebd (patch)
treecf1d108467833d9efb1d54a59e10b2d7e72d1bab /scripts
parent90ef7136087f1a16da3c8fc2decbed27a5debcd8 (diff)
downloadopenembedded-core-95185de6f149a495201701d260921339e3dfaebd.tar.gz
openembedded-core-95185de6f149a495201701d260921339e3dfaebd.tar.bz2
openembedded-core-95185de6f149a495201701d260921339e3dfaebd.zip
send-pull-request: verify git sendemail config
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 <dvhart@linux.intel.com> Acked-by: Otavio Salvador <otavio@ossystems.com.br> Cc: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/send-pull-request15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/send-pull-request b/scripts/send-pull-request
index 5a11d1f1e6..21eb302169 100755
--- a/scripts/send-pull-request
+++ b/scripts/send-pull-request
@@ -41,6 +41,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 "achp:t:" OPT; do
@@ -74,6 +86,9 @@ while getopts "achp: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