nu_scripts icon indicating copy to clipboard operation
nu_scripts copied to clipboard

Add `contributer` module, alternative to the `20k_club` script

Open Bahex opened this issue 3 months ago • 3 comments

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

Bahex avatar Aug 29 '25 11:08 Bahex

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

fdncred avatar Sep 03 '25 23:09 fdncred

@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"
    ]
    

Bahex avatar Sep 17 '25 13:09 Bahex

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.

fdncred avatar Sep 17 '25 13:09 fdncred