Repository navigation
bugfix: Fix git shortlog returning no output in non-TTY environments - #275
Merged
Merged
Conversation
travishathaway
marked this pull request as ready for review
May 15, 2026 09:39
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.
Introduction
Hi maintainers 👋,
This is my first contribution to this repository, so if I have not done anything correctly, please excuse me and just let me know what to do.
I found this bug while releasing conda 26.5.0. I specifically found it because I was using rever in an opencode session where it was in a non-TTY environment.
The bug fix submitted was something that my LLM (Claude Opus 4.6) suggested to me, and I have gone even further by including regression tests that we're also written by the LLM.
Please let me know if these change are acceptable and what I can do to improve them if they are not.
Thanks!
Full description of changes
git shortlogwithout an explicit revision reads from stdin. In non-interactive environments (CI, subprocess calls, agent runners) stdin is empty/closed, so it exits immediately with no output. This causedgit_commits_per_authorandgit_commits_per_emailto return empty dicts, silently setting every author'snum_commitsto 0.Fix by appending
HEADto the args when nosinceboundary is given, sogit shortlogalways traverses the full commit history regardless of whether stdin is a terminal. The same bug exists in bothgit_commits_per_authorandgit_commits_per_emailsince they share the same pattern.