diff options
author | Khem Raj <raj.khem@gmail.com> | 2011-03-12 07:07:12 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-03-16 13:54:17 +0000 |
commit | 9a1ee6de17b795f81a198f71fa004b8b02dee753 (patch) | |
tree | 7ccfeb8e8ff60fd29b290e96ef5c842ebc01d0ee | |
parent | c6d6e49d07fdc13d0c84db600a4403ca29bfa2f9 (diff) | |
download | poky-9a1ee6de17b795f81a198f71fa004b8b02dee753.tar.gz |
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.
(From OE-Core rev: dae83a48f86fd5907cc999e912f476c89debd0bb)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-x | scripts/send-pull-request | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/scripts/send-pull-request b/scripts/send-pull-request index 7f51a1b259..3af2a9fa7e 100755 --- a/scripts/send-pull-request +++ b/scripts/send-pull-request | |||
@@ -109,15 +109,17 @@ if [ $AUTO -eq 1 ]; then | |||
109 | harvest_recipients CC "^.*-[Bb][Yy]: *" | 109 | harvest_recipients CC "^.*-[Bb][Yy]: *" |
110 | fi | 110 | fi |
111 | 111 | ||
112 | if [ -z "$TO" ] && [ -z "$CC" ]; then | ||
113 | echo "ERROR: you have not specified any recipients." | ||
114 | usage | ||
115 | exit 1 | ||
116 | fi | ||
117 | |||
118 | case "$PULL_MTA" in | 112 | case "$PULL_MTA" in |
119 | git) | 113 | git) |
120 | FROM="$(git config sendemail.from)" | 114 | FROM="$(git config sendemail.from)" |
115 | AUTO_TO="$(git config sendemail.to)" | ||
116 | if [ -n "$AUTO_TO" ]; then | ||
117 | if [ -n "$TO" ]; then | ||
118 | TO="$TO,$AUTO_TO" | ||
119 | else | ||
120 | TO="$AUTO_TO" | ||
121 | fi | ||
122 | fi | ||
121 | ;; | 123 | ;; |
122 | sendmail) | 124 | sendmail) |
123 | if [ -z "$FROM" ]; then | 125 | if [ -z "$FROM" ]; then |
@@ -131,6 +133,13 @@ case "$PULL_MTA" in | |||
131 | ;; | 133 | ;; |
132 | esac | 134 | esac |
133 | 135 | ||
136 | if [ -z "$TO" ] && [ -z "$CC" ]; then | ||
137 | echo "ERROR: you have not specified any recipients." | ||
138 | usage | ||
139 | exit 1 | ||
140 | fi | ||
141 | |||
142 | |||
134 | # Generate report for the user and require confirmation before sending | 143 | # Generate report for the user and require confirmation before sending |
135 | cat <<EOM | 144 | cat <<EOM |
136 | The following patches: | 145 | The following patches: |