fix(update): preserve --depth 1 on shallow installs during update - #80124
Closed
JonthanaHanh wants to merge 1 commit into
Closed
JonthanaHanh wants to merge 1 commit into
JonthanaHanh wants to merge 1 commit into
Conversation
The `--check` path correctly detects shallow repos and appends `--depth 1` to fetch commands (line 2238-2247), but the actual update path at line 3749 did a bare `git fetch origin branch` without depth args. On shallow installs (the default from the installer), this unshallows the repo and drags in the entire git history — causing `hermes update` to hang for 20+ minutes on slow networks while downloading 179K+ objects. Add the same shallow detection before the update fetch so that `--depth 1` is preserved when the repo is shallow. Fixes NousResearch#80049
Collaborator
|
Thanks @JonthanaHanh — the "Found 9980 new commit(s)" symptom on issue #80049 is fixed on main by PR #86318, which makes the apply path treat the shallow-boundary count as unknown and recover the real number via the GitHub compare API ( |
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
--checkpath correctly detects shallow repos and appends--depth 1to fetch commands (lines 2238-2247), but the actual update path did a baregit fetch origin branchwithout depth args. On shallow installs (the default from the installer), this unshallows the repo and drags in the entire git history.Problem
hermes updateon a shallow git install triggers a full unshallow fetch (missing--depth 1in the update path) and shows no progress output while doing it. The terminal sits at "Fetching updates..." for 20+ minutes because it's downloading 179,583+ objects.Observed on a mainland-China network: 42 MB in ~9 minutes and nowhere near done, because the full repo history was being fetched when only the shallow boundary was needed.
Root cause
hermes_cli/update_cmd.pyline 3749 (before this fix):The
--checkpath at line 2238-2247 correctly does:But the actual update fetch did not reuse this logic.
Fix
Added the same shallow detection before the update fetch, and append
depth_argsto the fetch command. When the repo is shallow,--depth 1is passed to preserve the boundary. When not shallow, no args are added (full fetch is fine).Changes
hermes_cli/update_cmd.py: Addis_shallowdetection anddepth_argsbefore the update fetchFixes #80049