fix(cli): honor main tracking remote during update checks - #4424
Closed
kshitijk4poor wants to merge 1 commit into
Closed
fix(cli): honor main tracking remote during update checks#4424kshitijk4poor wants to merge 1 commit into
kshitijk4poor wants to merge 1 commit into
Conversation
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.
Problem
hermes updateand the CLI banner update check assumeorigin/mainis always the canonical update source.That is true for managed installs, but it is false in common contributor/dev checkouts where:
originpoints to a personal forkmaintracksupstream/mainIn that layout Hermes can fetch the fork, see
HEAD..origin/main == 0, and incorrectly printAlready up to date!even when the canonical upstream repo has newer commits.Root Cause
The update path and banner check hardcoded
origin/maininstead of resolving the configured tracking remote formain.That made update status depend on remote naming conventions rather than the repository's actual branch tracking configuration.
Fix
hermes_cli/update_git.pywithresolve_update_remote()branch.main.remotewhen it exists and the remote is configuredorigin, thenupstream, then the first configured remotehermes_cli.main.cmd_update()to fetch/pull/reset against the resolved update remotehermes_cli.banner.check_for_updates()to use the same remote resolutionTesting
python -m pytest tests/hermes_cli/test_cmd_update.py tests/hermes_cli/test_update_check.py tests/hermes_cli/test_update_git.py -qNotes
This fixes the false-positive "Already up to date" behavior in fork-based Hermes development checkouts while preserving existing behavior for normal installs where
maintracksorigin/main.