[U-Boot] [PATCH 5/8] patman: Provide option to ignore bad aliases
Simon Glass
sjg at chromium.org
Tue Mar 26 23:46:02 CET 2013
Hi Doug,
On Thu, Mar 21, 2013 at 10:09 AM, Doug Anderson <dianders at chromium.org> wrote:
> Simon,
>
> Nothing critical and this could go in as-is, but a few nits below.
>
>
> On Wed, Mar 20, 2013 at 7:42 PM, Simon Glass <sjg at chromium.org> wrote:
>> - raw += LookupEmail(item, alias)
>> + raw += LookupEmail(item, alias, raise_on_error=not ignore_errors)
>
> optional: Change it so functions are consistent about whether it's
> "raise_on_error" or "ignore_errors"
Will do.
>
>
>> + >>> EmailPatches(series, 'cover', ['p1', 'p2'], True, False, 'cc-fname', \
>> + False, alias)
>
> Doctest that actually tests the raise_on_error? See doctests in
> gitutil.py for example syntax.
It is tested by LookupEmail() below.
>
>
>> -def LookupEmail(lookup_name, alias=None, level=0):
>> +def LookupEmail(lookup_name, alias=None, raise_on_error=True, level=0):
>> """If an email address is an alias, look it up and return the full name
>>
>> TODO: Why not just use git's own alias feature?
>>
>> Args:
>> lookup_name: Alias or email address to look up
>> + alias: Dictionary containing aliases (None to use settings default)
>> + raise_on_error: True to raise an error when an alias fails to match
>
> ...and what happens if you pass False?
Will add comment.
>
>
>> + >>> LookupEmail('odd', alias, False)
>> + \033[1;31mAlias 'odd' not found\033[0m
>> + []
>> + >>> # In this case the loop part will effectively be ignored.
>> + >>> LookupEmail('loop', alias, False)
>> + \033[1;31mRecursive email alias at 'other'\033[0m
>> + \033[1;31mRecursive email alias at 'john'\033[0m
>> + \033[1;31mRecursive email alias at 'mary'\033[0m
>> + ['j.bloggs at napier.co.nz', 'm.poppins at cloud.net']
>
> optional nit: for optional args it's nice to specify them with keywords, like
> >>> LookupEmail('loop', alias=alias, raise_on_error=False)
>
> Please test the raise_on_error=True case.
Yes, that's the current ignore_errors=False I think, so I will keep this.
Regards,
Simon
More information about the U-Boot
mailing list