All of lore.kernel.org
 help / color / mirror / Atom feed
From: Darren Hart <dvhart@linux.intel.com>
To: Bruce Ashfield <bruce.ashfield@gmail.com>
Cc: Patches and discussions about the oe-core layer
	<openembedded-core@lists.openembedded.org>
Subject: Re: [RFC PATCH 10/10] send-pull-request: verify git sendemail config
Date: Mon, 16 May 2011 08:13:06 -0700	[thread overview]
Message-ID: <4DD13F02.4030506@linux.intel.com> (raw)
In-Reply-To: <BANLkTinQc5CtwEa9VO1-2AQriVA1u8fO=g@mail.gmail.com>

On 05/14/2011 07:48 PM, Bruce Ashfield wrote:
> On Sat, May 14, 2011 at 2:45 PM, Darren Hart <dvhart@linux.intel.com> wrote:
>>
>>
>> On 05/13/2011 10:43 PM, Bruce Ashfield wrote:
>>> On Fri, May 13, 2011 at 7:38 PM, Darren Hart <dvhart@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@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.
>>
>> This only impacts the send-pull-request script which requires
>> git-send-email to be configured in order to work, so it really can't be
>> an optional thing.
> 
> I meant making it optional from being in your .gitconfig. I use
> git send-email with a smtp server almost every day .. and it's
> not in my .gitconfig :)

Right, duh. OK, so it order to make this optional, we would have to add
all the necessary options to pass through from the script to
git-send-email. I'd really rather avoid that.

What is your objection to having a default smtp/from in your git config?
You can always override it on the command line, and with confirm=always
in your git config (you're sane right?) there is little risk of sending
from the wrong account accidentally.

--
Darren

> 
> Bruce
> 
>>
>> --
>> Darren
>>
>>>
>>> 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@lists.openembedded.org
>>>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>>>>
>>>
>>>
>>>
>>
>> --
>> Darren Hart
>> Intel Open Source Technology Center
>> Yocto Project - Linux Kernel
>>
> 
> 
> 

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel



  reply	other threads:[~2011-05-16 15:15 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-13 23:35 [RFC PATCH 00/10] *-pull-request: cleanup and overhaul Darren Hart
2011-05-13 23:36 ` [RFC PATCH 01/10] create-pull-request: alphabetize arguments Darren Hart
2011-05-13 23:36 ` [RFC PATCH 02/10] create-pull-request: whitespace cleanup Darren Hart
2011-05-13 23:37 ` [RFC PATCH 03/10] create-pull-request: use git request-pull and arbitrary remotes Darren Hart
2011-05-14  0:14   ` Joshua Lock
2011-05-14  2:04     ` Darren Hart
2011-05-14  3:19     ` Darren Hart
2011-05-16 16:31       ` Joshua Lock
2011-05-13 23:37 ` [RFC PATCH 04/10] create-pull-request: rewrite known private URLs to public URLs Darren Hart
2011-05-13 23:37 ` [RFC PATCH 05/10] create-pull-request: provide an RFC mode via -c argument Darren Hart
2011-05-13 23:37 ` [RFC PATCH 06/10] send-pull-request: whitespace cleanup Darren Hart
2011-05-13 23:38 ` [RFC PATCH 07/10] send-pull-request: remove local mta support Darren Hart
2011-05-13 23:38 ` [RFC PATCH 08/10] send-pull-request: fix greedy auto-cc regex Darren Hart
2011-05-14  5:41   ` Bruce Ashfield
2011-05-13 23:38 ` [RFC PATCH 09/10] send-pull-request: don't send all patches to everyone even with -a Darren Hart
2011-05-13 23:44   ` Khem Raj
2011-05-14  0:14     ` Joshua Lock
2011-05-14  0:31     ` Darren Hart
2011-05-13 23:38 ` [RFC PATCH 10/10] send-pull-request: verify git sendemail config Darren Hart
2011-05-14  5:43   ` Bruce Ashfield
2011-05-14 18:45     ` Darren Hart
2011-05-15  2:48       ` Bruce Ashfield
2011-05-16 15:13         ` Darren Hart [this message]
2011-05-16 15:16           ` Bruce Ashfield
2011-05-14  3:47 ` [RFC PATCH 00/10] *-pull-request: cleanup and overhaul Darren Hart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DD13F02.4030506@linux.intel.com \
    --to=dvhart@linux.intel.com \
    --cc=bruce.ashfield@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.