diff --git a/scripts/send-pull-request b/scripts/send-pull-request index 76dd7a2d91..d265c474c0 100755 --- a/scripts/send-pull-request +++ b/scripts/send-pull-request @@ -1,15 +1,9 @@ #!/bin/bash AUTO=0 -# Check env for any default settings, command line options will override these. -if [ -z "$PULL_MTA" ]; then - PULL_MTA="sendmail" -fi - # Prevent environment leakage to these vars. unset TO unset CC -# allow the user to set FROM in the environment usage() { @@ -18,10 +12,6 @@ Usage: $(basename $0) [-h] [-a] [[-t email]...] -p pull-dir -t email Explicitly add email to the recipients -a Automatically harvest recipients from "*-by: email" lines in the patches in the pull-dir - -f Specify a FROM address, you can also use the FROM environment - variable. If you do not specify one, it will try to use the one - from your git config. This is ignored if -g is used. - -g Use git-send-email to send mail instead of sendmail -p pull-dir Directory containing summary and patch files EOM } @@ -49,17 +39,11 @@ harvest_recipients() # Parse and verify arguments -while getopts "af:ghp:t:" OPT; do +while getopts "ahp:t:" OPT; do case $OPT in a) AUTO=1 ;; - f) - FROM="$OPTARG" - ;; - g) - PULL_MTA="git" - ;; h) usage exit 0 @@ -109,29 +93,14 @@ if [ $AUTO -eq 1 ]; then harvest_recipients CC "^.*-[Bb][Yy]: *" 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 +AUTO_TO="$(git config sendemail.to)" +if [ -n "$AUTO_TO" ]; then + if [ -n "$TO" ]; then + TO="$TO,$AUTO_TO" + else + TO="$AUTO_TO" fi - ;; -sendmail) - if [ -z "$FROM" ]; then - FROM="$(git config user.name) <$(git config user.email)>" - if [ -z "$FROM" ]; then - echo "ERROR: unable to determine a FROM address" - usage - exit 1 - fi - fi - ;; -esac +fi if [ -z "$TO" ] && [ -z "$CC" ]; then echo "ERROR: you have not specified any recipients." @@ -145,10 +114,7 @@ cat <