From: Marat Khalili <marat.khalili@huawei.com>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [PATCH 1/2] devtools/mailmap_ctl: script to work with mailmap
Date: Mon, 11 Aug 2025 11:27:48 +0000 [thread overview]
Message-ID: <64fdb8dac7904b17bc4bba5b907b16aa@huawei.com> (raw)
In-Reply-To: <aJZW_0ZJJ34q3LFs@bricha3-mobl1.ger.corp.intel.com>
> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Friday 8 August 2025 20:59
> To: Marat Khalili <marat.khalili@huawei.com>
> Cc: dev@dpdk.org
> Subject: Re: [PATCH 1/2] devtools/mailmap_ctl: script to work with mailmap
> > > +def check_mailmap(mailmap_path, _):
> > > + """Check that mailmap entries are correctly sorted and formatted."""
> >
> > As noted above, it will not fail if some entries are incorrectly formatted.
> >
> > Also, we could probably check for duplicates.
> >
> Yes, but I will leave this for future work, as I don't believe it's a
> problem we currently have with our mailmap file.
Completely agree that we don't have to solve all problems at once, especially those that don't exist :)
> > > + # Check if entry already exists, checking email2 only if it's specified
> > > + if (
> > > + not new_entry.email2
> > > + and any(e.name == new_entry.name and e.email1 == new_entry.email1 for e in entries)
> > > + ) or any(
> >
> > This will usually trigger even when `not new_entry.email2`.
> >
> Can you clarify this comment? Is there something I need to fix here?
When `not new_entry.email2` and there are no entries with `name` and `email1` matching new entry the interpreter will execute second `any` creating another iterator and running through all entries again this time looking for entries with `name`, `email1` and `email2` matching new entry, and never find anything since looser condition checking only `name` and `email1` failed earlier. Nothing would fail or behave differently now, it's just unnecessary work.
It's more like code smell than actual problem, so not worth another iteration unless you feel like it.
> > > + parser.add_argument("entry", nargs="?", help='Entry to add. Format: "Name <email@domain.com>"')
> >
> > Secondary email is not mentioned. Actually, if I want to add a secondary email when I already have primary,
> what do I do?
> >
> You hand-edit for now! :-)
> That is something that I think we should add in future, but I'm keeping it
> simple for now. [For most of the patch application that I do to my tree,
> it's only adding completely new entries to mailmap, so getting that working
> was my primary concern]
Yeah, I understand, no problem leaving this out for now.
next prev parent reply other threads:[~2025-08-11 11:27 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-08 14:27 [PATCH 0/2] Improve mailmap file Bruce Richardson
2025-08-08 14:27 ` [PATCH 1/2] devtools/mailmap_ctl: script to work with mailmap Bruce Richardson
2025-08-08 16:44 ` Marat Khalili
2025-08-08 16:47 ` Bruce Richardson
2025-08-08 19:58 ` Bruce Richardson
2025-08-11 11:27 ` Marat Khalili [this message]
2025-08-08 14:27 ` [PATCH 2/2] mailmap: sort mailmap Bruce Richardson
2025-08-08 21:08 ` [PATCH v2 0/2] Improve mailmap file Bruce Richardson
2025-08-08 21:08 ` [PATCH v2 1/2] devtools/mailmap_ctl: script to work with mailmap Bruce Richardson
2025-08-11 11:28 ` Marat Khalili
2025-08-08 21:08 ` [PATCH v2 2/2] mailmap: sort mailmap Bruce Richardson
2025-08-11 12:18 ` Marat Khalili
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=64fdb8dac7904b17bc4bba5b907b16aa@huawei.com \
--to=marat.khalili@huawei.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).