Skip to content

Conversation

@Bahex
Copy link
Member

@Bahex Bahex commented Aug 29, 2025

Uses github cli gh to fetch information through the github api to avoid cloning the repositories.

Uses github cli `gh` to fetch information through the github api to
avoid the need to clone the repositories.
@Bahex Bahex requested a review from fdncred August 29, 2025 11:45
Copy link
Contributor

@fdncred fdncred left a comment

Choose a reason for hiding this comment

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

The 20k club was created when nushell hit 20k stars on github as a way to say thanks to the community and give the most prolific contributors a place of honor in discord. It was meant to count PRs but IIRC it mostly counts commits but since our commits are squashed, it's kind of the same number.

I'm up for replacing the 20k club with something else and reusing the groups in discord but I want to leave the script in place for historical reasons.

I haven't ran your script yet but it seems reasonable by looking at it.

@fdncred
Copy link
Contributor

fdncred commented Sep 3, 2025

I finally ran this and I love it. I have a few questions.

  1. How can we map the users to discord users?
  2. Does this use the traditional git .mailmap file? For instance, I have 5 different usernames and email addresses for sophia.
  3. I'm not clear what a "contribution" is that it's counting. Any ideas?
  4. The numbers are quite different from my script

@Bahex
Copy link
Member Author

Bahex commented Sep 17, 2025

@fdncred

  1. GitHub accounts can be linked on discord profiles

  2. 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.

  3. 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
    • gh command: 86
    • git 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 api results are accurate.
    Otherwise I'll need to refactor to include co-authored commits as well.

  4. 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"
    ]

@fdncred
Copy link
Contributor

fdncred commented Sep 17, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants