Conversation
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 #53512 and #53498. Extracts a shared _get_remote_update_commit_count() helper that handles both shallow and non-shallow repos, and applies it to both cmd_update and cmd_update --check.
Note: Competing fix pair with #53512 and #53498. This is the most comprehensive of the three — it also fixes the --check path and extracts a reusable helper. The maintainer should reconcile which approach to merge.
Reviewed by Hermes Agent
teknium1
left a comment
There was a problem hiding this comment.
Thanks for covering both updater entry points and adding regression intent. The apply-path issue is still present on current main, but this patch needs a re-scope before it can fix it safely.
Problems
hermes_cli/main.py:9595-9600on current main fetches before the PR's proposed count helper would run. Merged #50784 (eecb5b9dd19a4234ebf64c45e5440d85c60a6696) establishes that shallow detection must occur before fetch and that shallow fetches need--depth 1; otherwise the checkout can be unshallowed before the guard evaluates it.- The
--checkportion is already implemented on main:hermes_cli/main.py:8486-8590detects shallow state pre-fetch, preserves depth, compares tip SHAs, and skipsrev-list.
Suggested changes
- Salvage the apply-path fix by moving the shallow probe ahead of
hermes_cli/main.py:9595and using a depth-preserving fetch plus SHA presence check there. - Drop the duplicate
--checkchanges and rebase the tests on the current updater layout.
Automated hermes-sweeper review.
| """ | ||
| shallow_result = subprocess.run( | ||
| git_cmd + ["rev-parse", "--is-shallow-repository"], | ||
| cwd=cwd, |
There was a problem hiding this comment.
This shallow probe is reached only after _cmd_update_impl has fetched from origin. The existing merged fix #50784 requires probing before fetch and using --depth 1; otherwise a plain fetch can unshallow the checkout before this guard runs, so the exact-count path remains reachable for the reported failure.
|
Closing — resolved by PR #86257 + #86318 (merged). Your |
Summary
hermes updateandhermes update --checkrev-list --countand show a generic update messageTesting