Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools,meta: make AUTHORS reflect all the contributors #88

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Timur Shemsedinov <timur.shemsedinov@gmail.com>
Alexey Orlenko <eaglexrlnk@gmail.com>
Mykola Bilochub <nbelochub@gmail.com>
3 changes: 3 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Timur Shemsedinov <timur.shemsedinov@gmail.com>
Dimon Durak <Dimon Durak>
Copy link
Member Author

Choose a reason for hiding this comment

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

@dimon-durak can you please provide your real name and email if you want to be included to the list?

Copy link
Member Author

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

Dmitry Borisov
dimon.durak@gmail.com

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, I've added an entry for you in .mailmap and regenerated the list of contributors.

Artem Chernenkiy <notthewhite@gmail.com>
Alexey Orlenko <eaglexrlnk@gmail.com>
Mykola Bilochub <nbelochub@gmail.com>
Vlad <Dzyubavlad@gmail.com>
Copy link
Member Author

Choose a reason for hiding this comment

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

@DzyubSpirit please check if you email is correct here. And how would you prefer your full name to be spelled?

Copy link
Member

Choose a reason for hiding this comment

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

Email is correct and I prefer to be Dzyuba WhatIsLove.

Thanks.

Copy link
Member Author

Choose a reason for hiding this comment

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

@DzyubSpirit I think we prefer real names unless you have strong reasons to not be called Vlad Dzyuba. I was asking about the correct spelling of your last name, actually :)
What about email, maybe I should have been more explicit too: the question is whether it should be written with a capital letter or I can lowercase it.

Copy link
Member

Choose a reason for hiding this comment

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

@aqrln, okey. Right spelling of my last name is Dziuba. Let it be this way. My email case does not matter, so you can do what it is needed with it.

Copy link
Member Author

Choose a reason for hiding this comment

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

@DzyubSpirit done.

27 changes: 27 additions & 0 deletions tools/common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Common utilities used by tools
'use strict';

const childProcess = require('child_process');
const fs = require('fs');

const common = {};
module.exports = common;

common.getCommandOutput = (cmd) => {
const exec = common.promisify(childProcess.exec);
return exec(cmd).then((stdout, stderr) => {
if (stderr) console.error(stderr);
return stdout;
});
};

common.promisify = (fn) => (...args) => (
new Promise((resolve, reject) => {
fn(...args, (error, ...result) => {
if (error) reject(error);
else resolve(...result);
});
})
);

common.writeFile = common.promisify(fs.writeFile);
24 changes: 2 additions & 22 deletions tools/prepare-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

'use strict';

const childProcess = require('child_process');
const fs = require('fs');
const https = require('https');
const path = require('path');

const { getCommandOutput, writeFile } = require('./common');

const commandName = path.relative('.', __filename);
const help = `\
This tool allows to filter the result of
Expand Down Expand Up @@ -83,14 +83,6 @@ getCommandOutput('git cherry ' + branch).then((cherryOut) => {
process.exit(1);
});

function getCommandOutput(cmd) {
const exec = promisify(childProcess.exec);
return exec(cmd).then((stdout, stderr) => {
if (stderr) console.error(stderr);
return stdout;
});
}

function getMetadata(commitHash) {
const command = 'git log --format="%aN%n%B" -n 1 ' + commitHash;
return getCommandOutput(command).then((output) => {
Expand Down Expand Up @@ -188,17 +180,6 @@ function getStreamData(stream, callback) {
stream.on('error', callback);
}

function promisify(fn) {
return (...args) => (
new Promise((resolve, reject) => {
fn(...args, (error, ...result) => {
if (error) reject(error);
else resolve(...result);
});
})
);
}

function processCommits(commits) {
commits = filterCommits(commits, maxLevel);

Expand Down Expand Up @@ -233,7 +214,6 @@ function processCommits(commits) {

script += '\n';

const writeFile = promisify(fs.writeFile);
return Promise.all([
writeFile(`${branch}-apply-commits.sh`, script),
writeFile(`${branch}-commits.md`, changelog)
Expand Down
24 changes: 24 additions & 0 deletions tools/update-authors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env node

'use strict';

const path = require('path');
const { getCommandOutput, writeFile } = require('./common');

const AUTHORS_PATH = path.resolve(__dirname, '..', 'AUTHORS');

getCommandOutput('git log --reverse --format="%aN <%aE>"').then((out) => {
const seen = new Set();
const authors = out.split('\n').reduce((list, author) => {
if (!seen.has(author)) {
list.push(author);
seen.add(author);
}
return list;
}, []);
return writeFile(AUTHORS_PATH, authors.join('\n'));
}).catch((error) => {
const message = error.stack || error.toString();
console.error(message);
process.exit(1);
});