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

Listing Github details for contributors between two tags #1355

Closed
danielbachhuber opened this issue Dec 6, 2016 · 5 comments
Closed

Listing Github details for contributors between two tags #1355

danielbachhuber opened this issue Dec 6, 2016 · 5 comments
Labels

Comments

@danielbachhuber
Copy link

One of the steps in WP-CLI's release process is to run ./utils/contrib-list (ref) to produce a list of contributors between two tags (or an existing tag and master). The end result is something like this:

image

However, the script is broken-ish right now. I've been meaning to fix it, but thought it might make a good contribution to hub instead. Something you'd consider a PR for?

@mislav
Copy link
Owner

mislav commented Dec 6, 2016

It's an interesting case but I don't think it belogs in hub core right now. A list of people's names is easily available through git log. I guess the complex part of this script would be mapping their email addresses to GitHub account handles?

@danielbachhuber
Copy link
Author

I guess the complex part of this script would be mapping their email addresses to GitHub account handles?

Right — doing some amount of authenticated Github.com API request to fetch these details.

@mislav
Copy link
Owner

mislav commented Dec 6, 2016

Here's a simple bash function that converts an email to a GitHub handle:

find_user() {
  curl -fsSL "https://api.github.com/search/users?q=in:email%20$1" | \
    grep '"login":' | cut -d'"' -f4
}

handle="$(find_user "mislav.marohnic@gmail.com")"
echo $handle #=> "mislav"

It will yield blank output if a user couldn't be found. In such cases, the person's full name from git log should be used instead of GitHub handle.

@sionleroux
Copy link
Contributor

If this isn't going to happen, should we consider this issue closed then?

@danielbachhuber
Copy link
Author

For this comfortable with PHP, here's what I ended up implementing for WP-CLI: https://github.com/wp-cli/wp-cli/blob/master/utils/contrib-list.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants