Conversation
Match the cmd_update path to the shallow-clone guard already used by the update banner and --check so installer clones stop printing bogus exact counts before pulling. Constraint: Preserve exact commit counts for full clones while matching the existing shallow-clone behavior in banner and --check. Rejected: share the desktop update-count helper | the CLI path already has the needed git probes and a local guard keeps the patch narrower. Confidence: high Scope-risk: narrow Directive: Keep cmd_update's shallow fetch and SHA-compare path aligned with hermes update --check when changing update-count behavior again. Tested: ./.venv/bin/pytest tests/hermes_cli/test_update_autostash.py tests/hermes_cli/test_update_check.py -q Tested: ./.venv/bin/pytest tests/hermes_cli/test_update_autostash.py -k shallow_clone -q Not-tested: Manual end-to-end hermes update run inside a real shallow checkout
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Comment
Addresses the same shallow clone bogus commit count issue as PR #53512 and #53494, with an additional improvement: adds --depth 1 for shallow fetches to prevent unshallowing the repo before deciding whether an exact count is trustworthy.
Note: Competing fix pair with #53512 and #53494. This PR uniquely adds the shallow fetch depth preservation. The maintainer should reconcile which approach to merge.
Reviewed by Hermes Agent
|
Thanks for the focused regression coverage. Current No blocking problems found in static review. The PR's shallow fetch and presence-only SHA comparison align the apply path with the existing check-path behavior, while preserving exact counts for non-shallow repositories. Automated hermes-sweeper review. |
|
Closing — resolved by PR #86318 (merged, d8d7cc0). Your PR was the earliest fix for this exact site (the apply path's unconditional |
What does this PR do?
Fixes the
hermes updateexecution path for shallow installer checkouts.cmd_update()was still fetching without--depth 1and always runninggit rev-list HEAD..origin/<branch> --count, even though the update banner andhermes update --checkalready treat shallow clones as a presence-only check. On a managed shallow checkout that could surface a bogus exact count before the pull.This patch keeps shallow fetches shallow, compares
HEADandorigin/<branch>by SHA in the shallow path, and prints a generic update-available message instead of a bogus exact commit count.Related Issue
Fixes #53479
Type of Change
Changes Made
hermes_cli/main.pybefore fetching updatesgit fetch --depth 1 origin <branch>incmd_update()rev-list --countin the shallowcmd_update()path and fall back to SHA comparisontests/hermes_cli/test_update_autostash.pyHow to Test
./.venv/bin/pytest tests/hermes_cli/test_update_autostash.py tests/hermes_cli/test_update_check.py -q./.venv/bin/pytest tests/hermes_cli/test_update_autostash.py -k shallow_clone -qhermes updateand confirm it prints a generic update-available message instead of a bogus exact commit count.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
cli-config.yaml.examplechanges neededCONTRIBUTING.mdorAGENTS.mdchanges neededScreenshots / Logs
./.venv/bin/pytest tests/hermes_cli/test_update_autostash.py tests/hermes_cli/test_update_check.py -q(50 passed)./.venv/bin/pytest tests/hermes_cli/test_update_autostash.py -k shallow_clone -q(2 passed)hermes update --checkpaths.