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

Comments

@danielbachhuber
Copy link

commented Dec 6, 2016

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Author

commented Dec 6, 2016

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

This comment has been minimized.

Copy link
Member

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.

@sinisterstuf

This comment has been minimized.

Copy link

commented Aug 26, 2017

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

@danielbachhuber

This comment has been minimized.

Copy link
Author

commented Aug 26, 2017

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
Projects
None yet
3 participants
You can’t perform that action at this time.