Repository navigation
Close revision operands with -- in Log, RevList, Diff and Patch [patch] - #223
Conversation
--end-of-options stops option parsing but leaves git guessing whether an operand is a revision or a path. A branch named like a tracked directory failed as "ambiguous argument", and a missing revision that matched a path returned that path's results with exit 0. A trailing -- after the revisions, as GitCheckoutBuilder already emits, settles both. Fixes #168 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016vf9SXXkfFir6zugMSNM3b
… [patch] Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016vf9SXXkfFir6zugMSNM3b
|
Generated by Claude Code |
|
|
I don't think this PR caused it. On the same commit, I've already used this PR's one re-run on the SonarCloud failure above, so I'm leaving this job for a maintainer to re-run. If it hangs a second time, treat it as a real hang worth investigating. The suspects would be the two new Generated by Claude Code |



Fixes #168
What changed
GitLogBuilder,GitRevListBuilder,GitDiffBuilderandGitPatchBuildernow emit--after their revision operands even when noForPath(...)follows.GitCheckoutBuilderalready did this.--end-of-optionsstops git reading an operand as a flag, but git still guesses whether that operand is a revision or a path until it sees--.docs) now resolves to the branch. Before, it failed withambiguous argument 'docs': both revision and filename.fatal: bad revision, surfaced asGitCommandException). Before, the call exited 0 and returned results filtered to that path.Log(), the implicitHEADused byExcludingRemoteTrackingRefs()gets the same--. A builder that emits no revision (for example a plainDiff()) has an unchanged argument vector.Tests
GitRoundTripTests.RevisionVerbsReadABranchNamedLikeADirectoryAsTheBranchAsync: with both adocsbranch and adocs/directory, Log, RevList, Diff and Patch return the branch's data.GitRoundTripTests.RevisionVerbsRejectAMissingRevisionThatMatchesAPathAsync: all four verbs throwGitCommandExceptionwhen there is nodocsrevision but adocs/path exists.GitRevListBuilderTests.BuildsTheDefaultCountVectorandGitLogBuilderTests.DefaultsTheUnpushedQueryToHeadnow expect the trailing--.Verification
GitDiffBuilderandGitPatchBuilder, but in different hunks, so whichever merges second should still merge cleanly.🤖 Generated with Claude Code
https://claude.ai/code/session_016vf9SXXkfFir6zugMSNM3b
Generated by Claude Code