Skip to content

Instantly share code, notes, and snippets.

@lorenzleutgeb
Last active November 19, 2025 00:38
Show Gist options
  • Select an option

  • Save lorenzleutgeb/239214f1d60b1cf8c79e7b0dc0483deb to your computer and use it in GitHub Desktop.

Select an option

Save lorenzleutgeb/239214f1d60b1cf8c79e7b0dc0483deb to your computer and use it in GitHub Desktop.
Nixpkgs Committer Progress
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p bash gh
set -eu
# MIT No Attribution (SPDX Identifier: MIT-0)
#
# Copyright 2023-2025 Lorenz Leutgeb, Peder Bergebakken Sundt
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify,
# merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
# PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# See <https://gist.github.com/lorenzleutgeb/239214f1d60b1cf8c79e7b0dc0483deb>.
# Will exit non-zero if not logged in.
gh auth status
if [ $# == 1 ]
then
# Pass GitHub login name as commandline argument.
LOGIN=$1
else
# Default to currently logged in user.
LOGIN=$(gh api user --jq .login)
fi
BASE="gh pr list --repo NixOS/nixpkgs --json id --jq length --limit 2000"
MERGED=$($BASE --author "$LOGIN" --state merged)
REVIEWED=$($BASE --search "reviewed-by:$LOGIN -author:$LOGIN" --state all)
COMMENTED=$($BASE --search "commenter:$LOGIN -reviewed-by:$LOGIN -author:$LOGIN" --state all)
INVOLVED=$($BASE --search "involves:$LOGIN -commenter:$LOGIN -reviewed-by:$LOGIN -author:$LOGIN" --state all)
REVIEWED_SANS_BOT=$($BASE --search "reviewed-by:$LOGIN -author:$LOGIN -author:r-ryantm" --state all)
COMMENTED_SANS_BOT=$($BASE --search "commenter:$LOGIN -reviewed-by:$LOGIN -author:$LOGIN -author:r-ryantm" --state all)
INVOLVED_SANS_BOT=$($BASE --search "involves:$LOGIN -commenter:$LOGIN -reviewed-by:$LOGIN -author:$LOGIN -author:r-ryantm" --state all)
cat << EOM
――――――――――
- [$MERGED PRs merged](https://github.com/NixOS/nixpkgs/issues?q=is%3Apr+is%3Amerged+author%3A$LOGIN)
- [$REVIEWED PRs reviewed](https://github.com/NixOS/nixpkgs/issues?q=is%3Apr+reviewed-by%3A$LOGIN+-author%3A$LOGIN)
- [$COMMENTED PRs otherwise commented](https://github.com/NixOS/nixpkgs/issues?q=is%3Apr+commenter%3A$LOGIN+-reviewed-by%3A$LOGIN+-author%3A$LOGIN)
- [$INVOLVED PRs otherwise involved](https://github.com/NixOS/nixpkgs/issues?q=is%3Apr+involves%3A$LOGIN+-commenter%3A$LOGIN+-reviewed-by%3A$LOGIN+-author%3A$LOGIN)
- [$REVIEWED_SANS_BOT PRs reviewed](https://github.com/NixOS/nixpkgs/issues?q=is%3Apr+reviewed-by%3A$LOGIN+-author%3A$LOGIN+-author%3Ar-ryantm) not opened by \`@r-ryantm\`
- [$COMMENTED_SANS_BOT PRs otherwise commented](https://github.com/NixOS/nixpkgs/issues?q=is%3Apr+commenter%3A$LOGIN+-reviewed-by%3A$LOGIN+-author%3A$LOGIN+-author%3Ar-ryantm) not opened by \`@r-ryantm\`
- [$INVOLVED_SANS_BOT PRs otherwise involved](https://github.com/NixOS/nixpkgs/issues?q=is%3Apr+involves%3A$LOGIN+-commenter%3A$LOGIN+-reviewed-by%3A$LOGIN+-author%3A$LOGIN+-author%3Ar-ryantm) not opened by \`@r-ryantm\`
EOM
@pbsds
Copy link

pbsds commented Oct 12, 2025

👍

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