Repository: zcash/zcash (language: rust)

Issue:
Add aliases to clean up duplicate entries in authors.md
* [x] Daira Hopwood -> Daira-Emma Hopwood
* [x] Daira Emma Hopwood -> Daira-Emma Hopwood
* [x] ebfull -> Sean Bowe
* [x] `ewillbefull@gmail.com` -> Sean Bowe
* [x] Yasser -> Yasser Isa (I think)
* [x] ying tong -> Ying Tong Lai
* [x] Za Wilcox -> Zancas Wilcox (or vice versa)


Discussion / hints:

Fix patch:
diff --git a/doc/authors.md b/doc/authors.md
index 41bf5ede28d..3374d9567e5 100644
--- a/doc/authors.md
+++ b/doc/authors.md
@@ -1,274 +1,264 @@
 Zcash Contributors
 ==================
 
-Jack Grigg (1430)
-Kris Nuttycombe (702)
-Simon Liu (460)
-Sean Bowe (409)
-Daira Hopwood (397)
-Eirik Ogilvie-Wigley (216)
-Greg Pfeil (208)
-Wladimir J. van der Laan (160)
-Pieter Wuille (153)
-Alfredo Garcia (120)
-Marshall Gaucher (119)
-Taylor Hornby (118)
-Marco Falke (91)
-Ying Tong Lai (90)
-Jonas Schnelli (90)
-Jay Graber (89)
-Larry Ruane (88)
-sasha (80)
-Cory Fields (78)
-Matt Corallo (62)
-Nathan Wilcox (57)
-Daira Emma Hopwood (54)
-practicalswift (43)
-Dimitris Apostolou (43)
-Kevin Gallagher (38)
-fanquake (37)
-Carl Dong (30)
-Alex Morcos (28)
-Luke Dashjr (27)
-Jorge Timón (25)
-Gregory Maxwell (24)
-John Newbery (23)
-Suhas Daftuar (20)
-furszy (18)
-Marius Kjærstad (18)
-Jonathan "Duke" Leto (18)
-Yasser Isa (17)
-syd (16)
-Patick Strateman (16)
-Charlie O'Keefe (16)
-avnish (14)
-Per Grön (14)
-Benjamin Winston (13)
-teor (12)
-Steven Smith (12)
-Pavel Janík (12)
-Patrick Strateman (12)
-Jeremy Rubin (12)
-Ariel Gabizon (12)
-Russell Yanofsky (11)
-Paige Peterson (11)
-Kaz Wesley (11)
-João Barbosa (11)
-Philip Kaufmann (10)
-Peter Todd (10)
-ying tong (9)
-nomnombtc (9)
-Zancas Wilcox (9)
-kozyilmaz (8)
-Jeff Garzik (8)
-James O'Beirne (8)
-Hennadii Stepanov (8)
-Chun Kuan Lee (8)
-Ben Wilson (8)
-Karl-Johan Alm (7)
-Alex Wied (7)
-David Mercer (6)
-Daniel Kraft (6)
-Daniel Cousens (6)
-Daira-Emma Hopwood (6)
-Casey Rodarmor (6)
-jnewbery (5)
-ca333 (5)
-MeshCollider (5)
-Johnathan Corgan (5)
-George Tankersley (5)
-Gavin Andresen (5)
-Gareth Davies (5)
-Conrado Gouvea (5)
-sandakersmann (4)
-instagibbs (4)
-gladcow (4)
-WO (4)
-Sjors Provoost (4)
-Nate Wilcox (4)
-Miodrag Popović (4)
-Jim Posen (4)
-Evan Klitzke (4)
-DeckerSU (4)
-Ben Woosley (4)
-mruddy (3)
-lpescher (3)
-isle2983 (3)
-elbandi (3)
-ebfull (3)
-Thomas Snider (3)
-NikVolf (3)
-Martin Ankerl (3)
-Julian Fleischer (3)
-Jason Davies (3)
-Ethan Heilman (3)
-Eric Lombrozo (3)
-Danny Willems (3)
-Anthony Towns (3)
-Alfie John (3)
-Aditya Kulkarni (3)
-ANISH M (3)
-whythat (2)
-shuoer86 (2)
-rofl0r (2)
-ptschip (2)
-noname45688@gmail.com (2)
-kpcyrd (2)
-kobake (2)
-hexabot (2)
-face (2)
-dependabot[bot] (2)
-aniemerg (2)
-Yuri Zhykin (2)
-UdjinM6 (2)
-Tim Ruffing (2)
-Solar Designer (2)
-Sebastian Falbesoner (2)
-Scott (2)
-S. Matthew English (2)
-Robert C. Seacord (2)
-Pejvan (2)
-Pavol Rusnak (2)
-Pavel Vasin (2)
-Mustafa (2)
-Matthew King (2)
-Mary Moore-Simmons (2)
-Mark Friedenbach (2)
-Marek (2)
-Jon Atack (2)
-Joe Turgeon (2)
-Jesse Cohen (2)
-Jeffrey Czyz (2)
-Jack Gavigan (2)
-ITH4Coinomia (2)
-Dan Raviv (2)
-Dagur Valberg Johannsson (2)
-Bryant Eisenbach (2)
-Brian Stafford (2)
-Brad Miller (2)
-Bjorn Hjortsberg (2)
-Amgad Abdelhafez (2)
-Alex Tsankov (2)
-Alex (2)
-Akio Nakamura (2)
-ロハン ダル (1)
-zathras-crypto (1)
-vim88 (1)
-user (1)
-unsystemizer (1)
-tulip (1)
-tpantin (1)
-sgmoore (1)
-randy-waterhouse (1)
-plutoforever (1)
-nathannaveen (1)
-murrayn (1)
-mrbandrews (1)
-kirkalx (1)
-kazcw (1)
-jeff-liang (1)
-jc (1)
-idm (1)
-glowang (1)
-ewillbefull@gmail.com (1)
-emilrus (1)
-dismad (1)
-dexX7 (1)
-daniel (1)
-cronicc (1)
-codetriage-readme-bot (1)
-calebogden (1)
-ayleph (1)
-avnish98 (1)
-adityapk00 (1)
-Za Wilcox (1)
-Yasser (1)
-William M Peaster (1)
-Vidar Holen (1)
-Vasil Dimov (1)
-Ulrich Kempken (1)
-TrellixVulnTeam (1)
-Tom Ritter (1)
-Tom Harding (1)
-Technetium (1)
-Stephen (1)
-Shaul Kfir (1)
-Ross Nicoll (1)
-Rod Vagg (1)
-Robert McLaughlin (1)
-Richard Littauer (1)
-René Nyffenegger (1)
-R E Broadley (1)
-Puru (1)
-Peter Pratscher (1)
-Peter Bushnell (1)
-Pedro Branco (1)
-Paul Georgiou (1)
-Paragon Initiative Enterprises, LLC (1)
-NicolasDorier (1)
-Nicolas DORIER (1)
-Nick (1)
-Nathaniel Mahieu (1)
-Murilo Santana (1)
-Miles Manley (1)
-Michał Janiszewski (1)
-Maxwell Gubler (1)
-Matt Quinn (1)
-Marko Bencun (1)
-Luv Khemani (1)
-Louis Nyffenegger (1)
-LongShao007 (1)
-LitecoinZ (1)
-Leo Arias (1)
-Lauda (1)
-Lars-Magnus Skog (1)
-Kristaps Kaupe (1)
-Kevin Pan (1)
-Karel Bilek (1)
-Josh Lehan (1)
-Josh Ellithorpe (1)
-Jonas Nick (1)
-Jon Layton (1)
-Jeffrey Walton (1)
-Janito Vaqueiro Ferreira Filho (1)
-James White (1)
-Jainan-Tandel (1)
-Igor Cota (1)
-Ian T (1)
-Ian Munoz (1)
-Ian Kelling (1)
-Gregory Sanders (1)
-Gaurav Rana (1)
-Forrest Voight (1)
-Florian Schmaus (1)
-Eran Tromer (1)
-Elliot Olds (1)
-Elijah Hampton (1)
-Dimitris Tsapakidis (1)
-DesWurstes (1)
-Denis Lukianov (1)
-David Llop (1)
-Christian von Roques (1)
-Chirag Davé (1)
-Cameron Boehmer (1)
-BtcDrak (1)
-Bryan Stitt (1)
-Bruno Arueira (1)
-Braydon Fuller (1)
-Boris Hajduk (1)
-Bob McElrath (1)
-Bitcoin Error Log (1)
-Bernhard M. Wiedemann (1)
-Ashley Holman (1)
-Andrés G. Aragoneses (1)
-Andrew Chow (1)
-Allan Niemerg (1)
-Alex van der Peet (1)
-Ahmad Kazi (1)
-Adam Weiss (1)
-Adam Langley (1)
-Adam Brown (1)
-Aaron Clauson (1)
-4ZEC (1)
-251 (1)
-21E14 (1)
+* Jack Grigg (2114)
+* Kris Nuttycombe (702)
+* Simon Liu (464)
+* Daira-Emma Hopwood (457)
+* Sean Bowe (413)
+* Eirik Ogilvie-Wigley (273)
+* Greg Pfeil (208)
+* Wladimir J. van der Laan (160)
+* Pieter Wuille (153)
+* Marshall Gaucher (125)
+* Alfredo Garcia (120)
+* Taylor Hornby (118)
+* Ying Tong Lai (99)
+* Marco Falke (91)
+* Jonas Schnelli (90)
+* Jay Graber (89)
+* Larry Ruane (88)
+* sasha (80)
+* Cory Fields (78)
+* Matt Corallo (62)
+* Nate Wilcox (61)
+* practicalswift (43)
+* Dimitris Apostolou (43)
+* Kevin Gallagher (38)
+* fanquake (37)
+* Carl Dong (30)
+* Patrick Strateman (28)
+* Alex Morcos (28)
+* Luke Dashjr (27)
+* Jorge Timón (25)
+* Gregory Maxwell (24)
+* John Newbery (23)
+* Suhas Daftuar (20)
+* Jonathan "Duke" Leto (19)
+* furszy (18)
+* Yasser Isa (18)
+* Marius Kjærstad (18)
+* syd (16)
+* Charlie O'Keefe (16)
+* Pavel Janík (15)
+* avnish (14)
+* Per Grön (14)
+* Benjamin Winston (13)
+* Ariel Gabizon (13)
+* teor (12)
+* Steven Smith (12)
+* Jeremy Rubin (12)
+* Russell Yanofsky (11)
+* Paige Peterson (11)
+* Kaz Wesley (11)
+* João Barbosa (11)
+* Zancas Wilcox (10)
+* Philip Kaufmann (10)
+* Peter Todd (10)
+* nomnombtc (9)
+* kozyilmaz (8)
+* Jeff Garzik (8)
+* James O'Beirne (8)
+* Hennadii Stepanov (8)
+* Chun Kuan Lee (8)
+* Ben Wilson (8)
+* Karl-Johan Alm (7)
+* Alex Wied (7)
+* David Mercer (6)
+* Daniel Kraft (6)
+* Daniel Cousens (6)
+* Casey Rodarmor (6)
+* jnewbery (5)
+* ca333 (5)
+* MeshCollider (5)
+* Johnathan Corgan (5)
+* George Tankersley (5)
+* Gavin Andresen (5)
+* Gareth Davies (5)
+* Ethan Heilman (5)
+* Conrado Gouvea (5)
+* sandakersmann (4)
+* instagibbs (4)
+* gladcow (4)
+* WO (4)
+* Sjors Provoost (4)
+* Miodrag Popović (4)
+* Jim Posen (4)
+* Evan Klitzke (4)
+* DeckerSU (4)
+* Ben Woosley (4)
+* mruddy (3)
+* lpescher (3)
+* isle2983 (3)
+* elbandi (3)
+* Thomas Snider (3)
+* NikVolf (3)
+* Martin Ankerl (3)
+* Julian Fleischer (3)
+* Jason Davies (3)
+* Eric Lombrozo (3)
+* Danny Willems (3)
+* Anthony Towns (3)
+* Alfie John (3)
+* Aditya Kulkarni (3)
+* ANISH M (3)
+* whythat (2)
+* shuoer86 (2)
+* rofl0r (2)
+* ptschip (2)
+* noname45688@gmail.com (2)
+* kpcyrd (2)
+* kobake (2)
+* hexabot (2)
+* face (2)
+* dependabot[bot] (2)
+* aniemerg (2)
+* Yuri Zhykin (2)
+* UdjinM6 (2)
+* Tim Ruffing (2)
+* Solar Designer (2)
+* Sebastian Falbesoner (2)
+* Scott (2)
+* S. Matthew English (2)
+* Robert C. Seacord (2)
+* Pejvan (2)
+* Pavol Rusnak (2)
+* Pavel Vasin (2)
+* Nicolas Dorier (2)
+* Mustafa (2)
+* Matthew King (2)
+* Mary Moore-Simmons (2)
+* Mark Friedenbach (2)
+* Marek (2)
+* Jon Atack (2)
+* Joe Turgeon (2)
+* Jesse Cohen (2)
+* Jeffrey Czyz (2)
+* Jack Gavigan (2)
+* ITH4Coinomia (2)
+* Dan Raviv (2)
+* Dagur Valberg Johannsson (2)
+* Bryant Eisenbach (2)
+* Brian Stafford (2)
+* Brad Miller (2)
+* Bjorn Hjortsberg (2)
+* Amgad Abdelhafez (2)
+* Alex Tsankov (2)
+* Alex (2)
+* Akio Nakamura (2)
+* ロハン ダル (1)
+* zathras-crypto (1)
+* vim88 (1)
+* user (1)
+* unsystemizer (1)
+* tulip (1)
+* tpantin (1)
+* sgmoore (1)
+* randy-waterhouse (1)
+* plutoforever (1)
+* nathannaveen (1)
+* murrayn (1)
+* mrbandrews (1)
+* kirkalx (1)
+* kazcw (1)
+* jeff-liang (1)
+* jc (1)
+* idm (1)
+* glowang (1)
+* emilrus (1)
+* dismad (1)
+* dexX7 (1)
+* daniel (1)
+* cronicc (1)
+* codetriage-readme-bot (1)
+* calebogden (1)
+* ayleph (1)
+* avnish98 (1)
+* adityapk00 (1)
+* William M Peaster (1)
+* Vidar Holen (1)
+* Vasil Dimov (1)
+* Ulrich Kempken (1)
+* TrellixVulnTeam (1)
+* Tom Ritter (1)
+* Tom Harding (1)
+* Technetium (1)
+* Stephen (1)
+* Shaul Kfir (1)
+* Ross Nicoll (1)
+* Rod Vagg (1)
+* Robert McLaughlin (1)
+* Richard Littauer (1)
+* René Nyffenegger (1)
+* R E Broadley (1)
+* Puru (1)
+* Peter Pratscher (1)
+* Peter Bushnell (1)
+* Pedro Branco (1)
+* Paul Georgiou (1)
+* Paragon Initiative Enterprises, LLC (1)
+* Nick (1)
+* Nathaniel Mahieu (1)
+* Murilo Santana (1)
+* Miles Manley (1)
+* Michał Janiszewski (1)
+* Maxwell Gubler (1)
+* Matt Quinn (1)
+* Marko Bencun (1)
+* Luv Khemani (1)
+* Louis Nyffenegger (1)
+* LongShao007 (1)
+* LitecoinZ (1)
+* Leo Arias (1)
+* Lauda (1)
+* Lars-Magnus Skog (1)
+* Kristaps Kaupe (1)
+* Kevin Pan (1)
+* Karel Bilek (1)
+* Josh Lehan (1)
+* Josh Ellithorpe (1)
+* Jonas Nick (1)
+* Jon Layton (1)
+* Jeffrey Walton (1)
+* Janito Vaqueiro Ferreira Filho (1)
+* James White (1)
+* Jainan-Tandel (1)
+* Igor Cota (1)
+* Ian T (1)
+* Ian Munoz (1)
+* Ian Kelling (1)
+* Gregory Sanders (1)
+* Gaurav Rana (1)
+* Forrest Voight (1)
+* Florian Schmaus (1)
+* Eran Tromer (1)
+* Elliot Olds (1)
+* Elijah Hampton (1)
+* Dimitris Tsapakidis (1)
+* DesWurstes (1)
+* Denis Lukianov (1)
+* David Llop (1)
+* Christian von Roques (1)
+* Chirag Davé (1)
+* Cameron Boehmer (1)
+* BtcDrak (1)
+* Bryan Stitt (1)
+* Bruno Arueira (1)
+* Braydon Fuller (1)
+* Boris Hajduk (1)
+* Bob McElrath (1)
+* Bitcoin Error Log (1)
+* Bernhard M. Wiedemann (1)
+* Ashley Holman (1)
+* Andrés G. Aragoneses (1)
+* Andrew Chow (1)
+* Allan Niemerg (1)
+* Alex van der Peet (1)
+* Ahmad Kazi (1)
+* Adam Weiss (1)
+* Adam Langley (1)
+* Adam Brown (1)
+* Aaron Clauson (1)
+* 4ZEC (1)
+* 251 (1)
+* 21E14 (1)
diff --git a/zcutil/release-notes.py b/zcutil/release-notes.py
index 8e4ecbd68e2..686b0206225 100755
--- a/zcutil/release-notes.py
+++ b/zcutil/release-notes.py
@@ -4,7 +4,6 @@
 import re, os, os.path
 import subprocess
 import argparse
-from itertools import islice
 from operator import itemgetter
 
 TEMP_RELEASE_NOTES_HEADER = [
@@ -25,21 +24,32 @@
 author_aliases = {
     'Ariel': 'Ariel Gabizon',
     'arielgabizon': 'Ariel Gabizon',
+    'bambam': 'Benjamin Winston',
     'bitcartel': 'Simon Liu',
     'Charlie OKeefe': 'Charlie O\'Keefe',
+    'Daira Emma Hopwood': 'Daira-Emma Hopwood',
+    'Daira Hopwood': 'Daira-Emma Hopwood',
     'Duke Leto': 'Jonathan \"Duke\" Leto',
+    'ebfull': 'Sean Bowe',
+    'ewillbefull@gmail.com': 'Sean Bowe',
     'Eirik0': 'Eirik Ogilvie-Wigley',
     'EthanHeilman': 'Ethan Heilman',
     'MarcoFalke': 'Marco Falke',
     'mdr0id': 'Marshall Gaucher',
+    'Nathan Wilcox': 'Nate Wilcox',
+    'NicolasDorier': 'Nicolas Dorier',
+    'Nicolas DORIER': 'Nicolas Dorier',
+    'Patick Strateman': 'Patrick Strateman',
     'paveljanik': 'Pavel Janík',
     'Sasha': 'sasha',
     'Simon': 'Simon Liu',
     'str4d': 'Jack Grigg',
-    'zebambam': 'Benjamin Winston',
     'therealyingtong': 'Ying Tong Lai',
+    'ying tong': 'Ying Tong Lai',
+    'Yasser': 'Yasser Isa',
     'zancas': 'Zancas Wilcox',
-    'bambam': 'Benjamin Winston'
+    'Za Wilcox': 'Zancas Wilcox',
+    'zebambam': 'Benjamin Winston',
 }
 
 def apply_author_aliases(name):
@@ -49,13 +59,13 @@ def apply_author_aliases(name):
         return name
 
 def parse_authors(line):
-    commit_search = re.search('\((\d+)\)', line)
+    commit_search = re.search(' \((\d+)\):', line)
     if commit_search:
-        commits = commit_search.group(1)
+        commits = int(commit_search.group(1))
+        name = re.sub(' \(\d+\)|:|\n|\r\n$', '', line)
+        return name, commits
     else:
-        commits = 0
-    name = re.sub(' \(\d+\)|:|\n|\r\n$', '', line)
-    return name, commits
+        return None, 0
 
 def alias_authors_in_release_notes(line):
     for key in author_aliases:
@@ -69,14 +79,11 @@ def authors_in_release_notes(filename):
     note = os.path.join(doc_dir, 'release-notes', filename)
     with open(note, mode='r', encoding="utf-8", errors="replace") as f:
         authors = {}
-        line = f.readline()
-        first_name, commits = parse_authors(line)
-        authors[apply_author_aliases(first_name)] = commits
         for line in f:
-            if line in ['\n', '\r\n']:
-                for author in islice(f, 1):
-                    name, commits = parse_authors(author)
-                    authors[apply_author_aliases(name)] = commits
+            name, commits = parse_authors(line)
+            if commits > 0:
+                name = apply_author_aliases(name)
+                authors[name] = authors.get(name, 0) + commits
         return authors
 
 ## Sums commits made by contributors in each Zcash release note in ./doc/release-notes and writes to authors.md
@@ -94,14 +101,12 @@ def document_authors():
             authors = authors_in_release_notes(notes)
             for author in authors:
                 commits = int(authors[author])
-                if author in total_contrib:
-                    total_contrib[author] += commits
-                else:
-                    total_contrib[author] = commits
+                total_contrib[author] = total_contrib.get(author, 0) + commits
+
         sorted_contrib = sorted(total_contrib.items(), key=itemgetter(1, 0), reverse=True)
         for n, c in sorted_contrib:
             if c != 0:
-                f.write("{0} ({1})\n".format(n, c))
+                f.write("* {0} ({1})\n".format(n, c))
 
 ## Writes release note to ./doc/release-notes based on git shortlog when current version number is specified
 def generate_release_note(version, prev, clear):


Test patch: