Conversation
_check_via_local_git() had two issues with the update-behind count: 1. Official SSH remotes: when _check_via_rev() returned UPDATE_AVAILABLE_NO_COUNT (SHA mismatch), the code fell back to a hardcoded return 1 — never doing the actual rev-list count. Now it falls through to _count_behind_full() to get the real count. 2. Factored _count_behind_full() out of the old inline logic so both the official-SSH path and the non-official-remote path share the same fetch+rev-list with shallow-clone handling.
Related to #61050 (earliest-open, same target bug: the official-SSH |
|
Thanks for targeting the real fabricated-count path: current Problems
Suggested changes
Automated hermes-sweeper review. |
|
Closing — superseded by PR #86257 (merged, bf10349) and PR #86331. Current main no longer hardcodes |
Summary
Fix
_count_behind_full()inbanner.pyto produce accurate behind-counts for official-SSH remote URLs and shallow clones.Problem
The old
_count_behind_full()had two defects:Official-SSH path hardcoded
return 1— when the remote was an SSH URL (e.g.git@github.com:NousResearch/hermes-agent.git), the function short-circuited and always reported "1 commit behind" regardless of actual state.Shallow clone handling — shallow clones lack full history, causing
git rev-listto fail. The old code didn't handle this gracefully.Solution
Refactored
_count_behind_full()to:git fetch --dry-run+git rev-listfor accurate behind-countsreturn 0(not 1) when history is unavailable (shallow clones)Testing
Manually verified on: