Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

src: improve tooling around AUTHORS file #9088

Closed
wants to merge 1 commit into from

Conversation

misterdjules
Copy link

This is a first draft to replace tools/updateAuthors.awk with tools/update-authors.js. The new
tool generates an AUTHORS file that is stable-ordered alphanumerically
(or more precisely "according to unicode code points").

The new tool also generates a .mailmap file that is essentially the same
content as the AUTHORS file, but with all email addresses used by each
author when committing changes to the repo.

As it is currently, the following section:

# These people didn't contribute patches to node directly,
-# but we've landed their v8 patches in the node repository:
-Daniel Clifford <danno@chromium.org>
-Erik Corry <erik.corry@gmail.com>
-Jakob Kummerow <jkummerow@chromium.org>
-Kevin Millikin <kmillikin@chromium.org>
-Lasse R.H. Nielsen <lrn@chromium.org>
-Michael Starzinger <mstarzinger@chromium.org>
-Toon Verwaest <verwaest@chromium.org>
-Vyacheslav Egorov <vegorov@chromium.org>
-Yang Guo <yangguo@chromium.org>

is removed by this tool, do we want to keep it?

Also, here's the output that shows that the newly generated .mailmap and AUTHORS include all the contributors:

➜  v0.12 git:(fix-issue-9077) ✗ git log --format='%aN' | sort | less | uniq | wc -l
     691
➜  v0.12 git:(fix-issue-9077) ✗ wc -l AUTHORS .mailmap                             
     691 AUTHORS
     691 .mailmap
    1382 total
➜  v0.12 git:(fix-issue-9077) ✗

@tjfontaine I'm interested in getting initial feedback to know if that corresponds to what you had in mind. If so, then I'll implement the stable-sort part and I'll update the PR.

* in their commits.
*/

"use strict";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for using strict mode. Small nit - single quotes are used throughout the rest of the file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, thanks!

@rvagg
Copy link
Member

rvagg commented Jan 27, 2015

feel free to use https://github.com/iojs/io.js/blob/v1.x/tools/update-authors.sh

we're still ordering by first-commit though (I don't see a good reason to order any other way)

@misterdjules
Copy link
Author

@rvagg Thanks for the heads-up!

One thing that I like with writing our tools as Node.js programs is that:

  • They run on all platforms supported by node, including Windows, out of the box.
  • We're doing more dogfooding, which we should do more in my opinion.

As for ordering alphanumerically instead of by first commit, the reason if I remember correctly is that it's even more "stable" across branches (with first-commit order, you could have the same set of authors but different AUTHORS files for two different branches), and in the end is simpler to reason about.

@misterdjules misterdjules force-pushed the fix-issue-9077 branch 2 times, most recently from fbf87e7 to f6fa4dc Compare January 29, 2015 02:36
@misterdjules
Copy link
Author

@cjihrig Thank you for the preliminary review! I made changes according to your comments, and pushed a more robust and complete version.

@misterdjules misterdjules force-pushed the fix-issue-9077 branch 2 times, most recently from 5e5b6a7 to 62e2b26 Compare January 29, 2015 23:17
@misterdjules misterdjules modified the milestones: 0.11.17, 0.11.16 Feb 2, 2015
@misterdjules misterdjules force-pushed the fix-issue-9077 branch 2 times, most recently from 8ba77aa to 4959789 Compare February 3, 2015 01:57
@misterdjules
Copy link
Author

I ended up not including the automatic generation of a .mailmap file with this tool. Indeed, .mailmap entries are of different forms with different meaning.

When generating them automatically, it is easy to add bogus entries that further confuse git log when using formats that use the .mailmap file (%aN and %aE). I think that fixing automatically generated entries in the AUTHORS file by hand when they are not valid (and manually adding the entries in the .mailmap if necessary) is safer, because they never taint the output of git log.

@tjfontaine
Copy link

I agree with generating the mailmap by hand, there are still some places where humans have better/more context. We can potentially improve the tooling like git-apply-pr to have an interactive mode or verification mode to manage the authors while committing as opposed to releasing.

All in all this is a great step in the maintainable direction -- thanks @misterdjules LGTM

Replace tools/updateAuthors.awk with tools/update-authors.js. The new
tool generates an AUTHORS file that is stable-ordered alphanumerically.

Fixes nodejs#9077.
misterdjules pushed a commit to misterdjules/node that referenced this pull request Feb 5, 2015
Replace tools/updateAuthors.awk with tools/update-authors.js. The new
tool generates an AUTHORS file that is stable-ordered alphanumerically.

Fixes nodejs#9077.

PR: nodejs#9088
PR-URL: nodejs#9088
Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
@misterdjules
Copy link
Author

@tjfontaine Thanks! Landed in 31610d0.

gibfahn pushed a commit to ibmruntimes/node that referenced this pull request Oct 16, 2016
* build: Fix building with shared zlib. (Bradley T. Hughes) [nodejs#9077](nodejs/node#9077)
* stream: fix `Writable` subclass instanceof checks (Anna Henningsen) [nodejs#9088](nodejs/node#9088)
* timers: fix regression with clearImmediate() (Brian White) [nodejs#9086](nodejs/node#9086)

PR-URL: nodejs/node#9104
kaiquewdev pushed a commit to kaiquewdev/node that referenced this pull request Nov 26, 2016
* build: Fix building with shared zlib. (Bradley T. Hughes) [nodejs#9077](nodejs/node#9077)
* stream: fix `Writable` subclass instanceof checks (Anna Henningsen) [nodejs#9088](nodejs/node#9088)
* timers: fix regression with clearImmediate() (Brian White) [nodejs#9086](nodejs/node#9086)

PR-URL: nodejs/node#9104
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants