Grok git config sendmail.to if available
v2 cover Grok git config sendmail.to if available
includes Darren's review comments
Pull URL: git://git.openembedded.org/openembedded-core-contrib
Branch: kraj/scripts
Browse: http://git.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=kraj/scripts
Thanks,
Khem Raj <[email protected]>
---
Khem Raj (1):
send-pull-request: Fetch TO email address from git config if
specified
scripts/send-pull-request | 21 +++++++++++++++------ 1 files changed, 15 insertions(+), 6 deletions(-)
Signature · 1 line
1.7.4.1
PATCH v2 1/1 send-pull-request: Fetch TO email address from git config if specified
Usually people using git send-email has git config sendmail.to configured to the usual mailing list or person so we harness that here.
--- scripts/send-pull-request | 21 +++++++++++++++------ 1 files changed, 15 insertions(+), 6 deletions(-)
scripts/send-pull-request +15 -6
@@ -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 <<EOM The following patches:
Signature · 1 line
1.7.4.1
Re: [PATCH, v2 1/1] send-pull-request: Fetch TO email address from git config if specified
Quoted 3 lines · Khem Raj
Usually people using git send-email has git config sendmail.to configured to the usual mailing list or person so we harness that here.
Right, looks sane to me.
Quoted 2 lines
Signed-off-by Khem Raj<[email protected]>
Please see below all the same:
Quoted 19 lines
--- scripts/send-pull-request | 21 +++++++++++++++------ 1 files changed, 15 insertions(+), 6 deletions(-)scripts/send-pull-request +0
-6@@ -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
scripts/send-pull-request if [ $AUTO -eq 1 ]; then · line 122
Quoted 10 lines
scripts/send-pull-request +8
-0git) 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
Quite the abuse of tabs and spaces for indentation here, but judging from the contextual lines, I don't have any right to point the finger here :-) I'll clean up the whitespace after this hits master.
What's the rule in poky, tabs for bash, spaces for python?
--
Darren
Quoted 17 lines
scripts/send-pull-request +7
-0;; 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<<EOM The following patches:
Signature · 3 lines
Darren Hart Intel Open Source Technology Center Yocto Project - Linux Kernel
Richard Purdie
AppliedQuoted 11 lines · Khem Raj
includes Darren's review comments
Pull URL:
git://git.openembedded.org/openembedded-core-contrib
Branch: kraj/scripts
Browse: http://git.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=kraj/scriptsThanks,
Khem Raj <[email protected]>
---
Quoted 6 lines
Khem Raj (1):
send-pull-request: Fetch TO email address from git config if
specifiedscripts/send-pull-request | 21 +++++++++++++++------ 1 files changed, 15 insertions(+), 6 deletions(-)
Merged to master, thanks.
Richard