git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] send-email: allow use of basic email list in --cc --to and --bcc

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Jun 19, 2013, 11:51 UTC
Message-ID
<vpqwqpqjp3t.fsf@anie.imag.fr>
In-Reply-To
<1371641640-3897-1-git-send-email-Jorge-Juan.Garcia-Garcia@ensimag.imag.fr>
Jorge-Juan.Garcia-Garcia@ensimag.imag.fr writes:
> Changes since v1:
> [...]
>  - did not change the two regexp into one, because it's faster with two
(I find it strange to describe non-change in a list of changes)

I don't think speed is an argument here: it's a one-time operation and will be instantaneous for the user in any case.

Show 8 quoted lines
> +sub split_emails {
> +    my ($emails) = @_;
> +    my @split_list;
> +    if ($emails =~ /,/) {
> +	@split_list = split(/,/, $emails);
> +    } else {
> +	@split_list = $emails;
> +    }

Do you need this "if"? Wouldn't split do the right thing if $emails does not contain comma?

> +    # Removal of unwanted spaces
> +    for (my $j = 0; $j <= $#split_list; $j++) {
Sounds very un-perl-ish. Something like this maybe?
foreach $email (@emails) {
	$email =~ s/^\s+|\s+$//;
}
> +    return @split_list;
> +}

This is indented with tab/spaces mix. Please, use tabs only in Git's source.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: jorge-juan.garcia-garcia@ensimag.imag.fr
Message 2 of 2 in “send-email: allow use of basic email list in --cc --to and --bcc”
  1. send-email: allow use of basic email list in --cc --to and --bccjorge-juan.garcia-garcia@ensimag.imag.fr, Jun 19, 2013
  2. Matthieu MoyJun 19, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.