Conversation
Desktop auto-update checks (checkUpdates) and `hermes update` (_cmd_update_impl) run a plain `git fetch` on the checkout. On an installer shallow clone (`git clone --depth 1`) a bare fetch cancels the shallow boundary and transfers the entire repository history — measured 337MB on a real install, with .git growing to 591MB. Detect shallow repos up front and fetch with --depth 1, mirroring the existing guard in banner.py and the update-check path. Full clones keep the exact fetch behavior.
Collaborator
|
Thanks @bydbot — closing as wrong-premise/superseded after verification. A branch-scoped |
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
Shallow installs (
git clone --depth 1) get silently unshallowed by update fetches, dragging in the entire repository history (hundreds of MB).Two call sites run a plain
git fetchon the checkout:checkUpdates()inapps/desktop/electron/main.tsrunsgit fetch --quiet origin mainevery ~10-30 minutes while the app is open. On a shallow clone a bare fetch cancels the shallow boundary and transfers the full history. Measured impact on a real installer checkout:.gitgrew from ~20MB to 591MB (a 337MB full-history pack, plus a 200MB orphanedtmp_pack_*from an interrupted fetch).hermes update—_cmd_update_impl()inhermes_cli/update_cmd.pyrunsgit fetch origin <branch>with no depth guard.The CLI update-check path (
update_cmd.pycheck +banner.py) already detects shallow repos and fetches with--depth 1to preserve the boundary — this PR aligns the two remaining call sites with that guard.Changes
apps/desktop/electron/main.ts: incheckUpdates(), probe--is-shallow-repositorybefore fetching and pass--depth 1when shallow (mirrorsbanner.py). The existing--is-shallow-repository/merge-baselogic further down already handles the shallow case for the behind-count.hermes_cli/update_cmd.py: in_cmd_update_impl(), reuse the same shallow probe +depth_argspattern already used by the update-check path.Verification
bundle-electron-main.mjsbuild passes; bundledelectron-main.mjscontains the--depth 1fetch branch.python -m py_compile hermes_cli/update_cmd.pypasses.--depthadded when not shallow).