From 0c7825accd9ad960cc045e503bb4edab3a955b2a Mon Sep 17 00:00:00 2001 From: Issy Long Date: Mon, 1 Aug 2022 17:38:56 +0100 Subject: [PATCH] dev-cmd/contributions: Make the first arg either a name or email MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - This is easier than mapping GitHub usernames to email addresses, when folks don't have email addresses always public on their GitHub profiles. Also, the users of this command (PLC members, other interested parties) don't have to remember folks' email addresses. - It also gives better data for people who've changed their name over the years, and who commit with multiple email addresses (personal and work). ``` ❯ brew contributions "Issy Long" all Person Issy Long directly authored 687 commits and co-authored 33 commits across all Homebrew repos in all time. ❯ brew contributions "Rylan Polster" all Person Rylan Polster directly authored 1747 commits and co-authored 133 commits across all Homebrew repos in all time. ❯ brew contributions me@issyl0.co.uk all Person me@issyl0.co.uk directly authored 711 commits and co-authored 25 commits across all Homebrew repos in all time. ❯ brew contributions "Mike McQuaid" all Person Mike McQuaid directly authored 26879 commits and co-authored 204 commits across all Homebrew repos in all time. ``` --- Library/Homebrew/dev-cmd/contributions.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/dev-cmd/contributions.rb b/Library/Homebrew/dev-cmd/contributions.rb index f51e6fdb99..38a3888ca9 100755 --- a/Library/Homebrew/dev-cmd/contributions.rb +++ b/Library/Homebrew/dev-cmd/contributions.rb @@ -17,10 +17,12 @@ module Homebrew sig { returns(CLI::Parser) } def contributions_args Homebrew::CLI::Parser.new do - usage_banner "`contributions` " + usage_banner "`contributions` " description <<~EOS Contributions to Homebrew repos for a user. + The first argument is a name (e.g. "BrewTestBot") or an email address (e.g. "brewtestbot@brew.sh"). + The second argument is a comma-separated list of repos to search. Specify to search all repositories. Supported repositories: #{SUPPORTED_REPOS.join(", ")}. @@ -32,7 +34,7 @@ module Homebrew flag "--to=", description: "Date (ISO-8601 format) to stop searching contributions." - named_args [:email, :repositories], min: 2, max: 2 + named_args [:email, :name, :repositories], min: 2, max: 2 end end