[OE-core] [RFC PATCH 10/10] send-pull-request: verify git sendemail config
Bruce Ashfield
bruce.ashfield at gmail.com
Sat May 14 05:43:30 UTC 2011
On Fri, May 13, 2011 at 7:38 PM, Darren Hart <dvhart at linux.intel.com> wrote:
> 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 at linux.intel.com>
> ---
> 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"
I was going to ask for this to be optional, since I always pass the smtp
settings on the command line .. but then I realized that I invoke git send-email
directly anyway, so I don't need it to be optional. :)
Regardless, reading this from git config is good idea, so the above is
only a comment.
Bruce
> + 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
> --
> 1.7.1
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
--
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"
More information about the Openembedded-core
mailing list