Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scripts/get_maintainer.pl: add --file-emails, find embedded email add…
…resses Add an imperfect option to search a source file for email addresses. New option: --file-emails or --fe email addresses in files are freeform text and are nearly impossible to parse. Still, might as well try to do a somewhat acceptable job of finding them. This code should find all addresses that are in the form [email protected] The code assumes that up to 3 alphabetic words along with dashes, commas, and periods that preceed the email address are a name. If 3 words are found for the name, and one of the first two words are a single letter and period, or just a single letter then the 3 words are use as name otherwise the last 2 words are used. Some variants that are shown correctly: John Smith <[email protected]> Random J. Developer <[email protected]> Random J. Developer ([email protected]) J. Random Developer [email protected] Variants that are shown nominally correctly: Written by First Last ([email protected]) is shown as: First Last <[email protected]> Variants that are shown incorrectly: Some Really Long Name <[email protected]> MontaVista Software, Inc. <[email protected]> are returned as: Long Name <[email protected]> "Software, Inc" <[email protected]> --roles and --rolestats show "(in file)" for matches. For instance: Without -file-emails: $ ./scripts/get_maintainer.pl -f -nogit -roles net/core/netpoll.c David S. Miller <[email protected]> (maintainer:NETWORKING [GENERAL]) [email protected] (open list) With -fe: $ ./scripts/get_maintainer.pl -f -fe -nogit -roles net/core/netpoll.c David S. Miller <[email protected]> (maintainer:NETWORKING [GENERAL]) Matt Mackall <[email protected]> (in file) Ingo Molnar <[email protected]> (in file) [email protected] (open list) [email protected] (open list:NETWORKING [GENERAL]) The number of email addresses in the file in not limited. Neither is the number of returned email addresses. Signed-off-by: Joe Perches <[email protected]> Cc: Matt Mackall <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information