fix: skip bogus shallow update counts - #53512
supplefrog wants to merge 1 commit into
Conversation
|
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Comment
Fixes bogus shallow commit counts in cmd_update by detecting shallow repos and comparing tip SHAs instead of using rev-list --count. Includes a dedicated test.
Note: Competing fix pair detected — PRs #53498 and #53494 address the same issue. PR #53498 also adds --depth 1 for shallow fetches; PR #53494 extracts a shared _get_remote_update_commit_count() helper. All three implementations are independently sound. The maintainer should reconcile which approach to merge.
Reviewed by Hermes Agent
Summary
hermes updateskipgit rev-list --countwhen a shallow install has no visible merge-base withorigin/<branch>Fixes #53479
Test Plan
python -m pytest tests/hermes_cli/test_cmd_update.py::TestCmdUpdateBranchFallback::test_update_shallow_without_merge_base_does_not_count_history -q— passedpython -m py_compile hermes_cli/main.py tests/hermes_cli/test_cmd_update.py— passednode --test apps/desktop/electron/update-count.test.cjs— passedNotes
python -m pytest tests/hermes_cli/test_cmd_update.py -qcurrently has Windows-local baseline failures unrelated to this change: one expectation assumes bare['git']while production uses['git', '-c', 'windows.appendAtomically=false'], and one npm-call assertion does not observe npm calls in this Windows mocked run. The new regression test passes independently.