Re: [PATCH 1/3] git-multimail: Add an option to filter on branches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/22/2015 12:46 PM, Dave Boutcher wrote:
> The only code I'm not fond of is matching on a list of regular
> expressions.  There must be a more pythonic way to do:
> 
> + return [x for x in [r.match(branch) for r in branches] if x]
> 
> which basically returns true if "branch" matches any regular
> expression in the list.

I think what you are looking for is

    return any(r.match(branch) for r in branches)

This also has the advantage of stopping processing as soon as it finds a
match.

I was also wondering why you decided to support comma-separated lists of
regexps *and* multivalued config settings. It seems that supporting only
multivalued settings would suffice.

Maybe you are following the precedent of our email configuration
settings, which support comma-separated lists of email addresses? If so,
I don't think that is necessary. The email support is there for
backwards compatibility and because comma-separated email addresses are
a thing in RFC 2822. Neither of these arguments apply to branch regexps.

> I pushed this change out to our production git server (its good to be
> the king.)  I'll obviously update here if it does anything too
> unfortunate.

Thanks.

Michael

-- 
Michael Haggerty
mhagger@xxxxxxxxxxxx

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]