Repository navigation
Name HEAD when ExcludingRemoteTrackingRefs has no revision [patch] - #211
Open
matt-edmondson wants to merge 1 commit into
Open
matt-edmondson wants to merge 1 commit into
matt-edmondson wants to merge 1 commit into
Conversation
git falls back to HEAD only when no revision input was given, and --remotes counts as input even when negated, so the bare Log().ExcludingRemoteTrackingRefs() ran "git log --not --remotes --not" and listed nothing, which reads as "nothing unpushed". The builder now appends HEAD when neither ForRevision nor IncludingAllRefs was called. Fixes #161 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BkmjSwCY4KW87X2ccQhj7T
|
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.



Fixes #161
What changed
git only falls back to
HEADwhen no revision input was given at all, and--remotescounts as input even when it is negated. So the bareLog().ExcludingRemoteTrackingRefs()rangit log --not --remotes --notand listed nothing, which reads as "nothing unpushed".GitLogBuildernow appendsHEADthroughAppendOperands(after--end-of-options, outside the closed negation) whenExcludingRemoteTrackingRefs()is set and neitherForRevisionnorIncludingAllRefs()was called. The interface remarks now describe this default.Tests
DefaultsTheUnpushedQueryToHeadchecks thatHEADis the last operand and comes after the closing--not.AddsNoHeadWhenAllRefsAreIncludedchecks the--allform is unchanged.ReportsUnpushedCommitsFromHeadWithoutARevisionAsyncuses a remote that is behind HEAD and expects exactly the one unpushed commit.ReportsEveryCommitAsUnpushedWithoutAnyRemoteAsyncuses a repository with no remote and expects every commit.HEADappend for a no-op. All three behavioural tests failed, then passed again once the change was restored.KTSU_GIT_INTEGRATION_TESTS_REQUIRED=1: 804 of 804 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_01BkmjSwCY4KW87X2ccQhj7T
Generated by Claude Code