> -----Original Message-----
> From: openembedded-core-boun...@lists.openembedded.org
> [mailto:openembedded-core-boun...@lists.openembedded.org] On Behalf Of
> Paul Eggleton
> Sent: den 3 november 2017 04:16
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCH 3/3] scripts/send-pull-request: allow -C to
> be used multiple times
> 
> Allow -C to be specified multiple times in order to CC multiple people
> instead of only taking the last specified value. (You can already use
> commas to separate multiple recipients, but it makes sense to support
> this usage as well as commas as separators may not be immediately
> obvious).
> 
> Signed-off-by: Paul Eggleton <paul.eggle...@linux.intel.com>
> ---
>  scripts/send-pull-request | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/send-pull-request b/scripts/send-pull-request
> index 883deac..baa907d 100755
> --- a/scripts/send-pull-request
> +++ b/scripts/send-pull-request
> @@ -82,7 +82,7 @@ while getopts "acC:hp:t:" OPT; do
>               GITSOBCC="--signed-off-by-cc"
>               ;;
>       C)
> -             EXTRA_CC="$OPTARG"
> +             EXTRA_CC="$EXTRA_CC,$OPTARG"

That will introduce a leading comma in $EXTRA_CC, which in turn will 
lead to a --cc='' option being passed to git send-email. You can avoid 
that by doing:

                EXTRA_CC="${EXTRA_CC:+$EXTRA_CC,}$OPTARG"

>               ;;
>       h)
>               usage
> --
> 2.9.5

You can also rewrite the case statement for -t in a similar way:

        t)
                TO="${TO:+$TO,}$OPTARG"
                ;;

Similarly, you can rewrite the code that assigns AUTO_CC in 
harvest_recipients() as:

                                AUTO_CC="${AUTO_CC:+$AUTO_CC,}$EMAIL"

And if you replace:

unset TO

near the beginning of the script with:

TO=$(git config sendmail.to)

you can remove everything related to AUTO_TO.

//Peter

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to