Add `contributer` module, alternative to the `20k_club` script
Uses github cli gh to fetch information through the github api to avoid cloning the repositories.
I finally ran this and I love it. I have a few questions.
- How can we map the users to discord users?
- Does this use the traditional git .mailmap file? For instance, I have 5 different usernames and email addresses for sophia.
- I'm not clear what a "contribution" is that it's counting. Any ideas?
- The numbers are quite different from my script
@fdncred
-
GitHub accounts can be linked on discord profiles
-
It uses the GitHub accounts linked to commits, so different names an emails shouldn't matter as long as they are linked to the same GitHub account.
-
It's supposed to match the info on https://github.com/nushell/nushell/graphs/contributors ~~but I'm getting inconsistent results~~
For me in
nushell/nushell:- the web page: 98
ghcommand: 86git log --author Bahex: 86- authored and co-authored combined: 98
def git-commits-by [author: string]: nothing -> int { alias grl = ^git rev-list main [ (grl --author $author | lines) (grl --fixed-strings --grep $'Co-authored-by: ($author)' | lines) ] | flatten | uniq | length }
If we're just counting PRs (like discord roles suggest) then
gh apiresults are accurate. Otherwise I'll need to refactor to include co-authored commits as well. -
What repos are you checking? This script checks these:
const default_repos = [ "nushell/new-nu-parser" "nushell/nu-ansi-term" "nushell/nushell" "nushell/nushell.github.io" "nushell/nu_scripts" "nushell/reedline" "nushell/tree-sitter-nu" "nushell/vscode-nushell-lang" ]
co-authored should probably be included imo. i'll send you the tracking spreadsheet on discord. it's not easy to map from gh to discord but that shouldn't stop this from going forward. that is already a problem with the original script.