Count squash-merge commits into the contributions count - #23221
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates brew contributions to include squash-merged (and other non-merge-commit) PRs in contribution counts by supplementing local Git history parsing with a GitHub “merged PRs authored” search.
Changes:
- Always queries GitHub for authored merged PRs in the date range and uses the result to top up per-repository
merged_pr_author/merged_prcounts beyond what can be derived from merge commits alone. - Adds a spec that verifies squash-merged PRs are counted even when a repository has local Git history.
- Updates existing specs to account for the new GitHub merged-PR search.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Library/Homebrew/dev-cmd/contributions.rb | Adds GitHub merged-PR search and “top-up” logic to count squash-merged PRs alongside Git-derived counts. |
| Library/Homebrew/test/dev-cmd/contributions_spec.rb | Adds/adjusts specs to validate squash-merge counting and the new GitHub search behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
MikeMcQuaid
reviewed
Jul 20, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
MikeMcQuaid
reviewed
Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?I used codex 5.6 to generate most of the change. I reviewed the code, ran the tests and checked the command output manually for my username.
The contribution command was ignoring squash-merged PRs and normal merge commits whose head branch is under Homebrew/... rather than a contributor’s fork. (for example Homebrew/homebrew-core#286711 )
A quick check I used:
brew contributions --user=moisan --from=2025-12-01 --to=2026-03-01. It was showing no authored PRs previously and 37 with this change.