fix(banner): prefer installed repo path in check_for_updates - #6330
Closed
zerone0x wants to merge 1 commit into
Closed
fix(banner): prefer installed repo path in check_for_updates#6330zerone0x wants to merge 1 commit into
zerone0x wants to merge 1 commit into
Conversation
Previously check_for_updates preferred ~/.hermes/hermes-agent, which caused 'N commits behind' to be reported indefinitely when that path was a stale clone separate from the repo the user actually runs from. Resolve against the project root (where __file__ lives) first, and only fall back to ~/.hermes/hermes-agent when the project root is not a git checkout. Fixes #6319
Collaborator
Contributor
Author
|
Thanks, confirmed the overlap:
Since neither related PR is merged/closed as the chosen fix, I am leaving this open for maintainer selection. No code update is needed here unless maintainers want this variant adjusted. |
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.
Fixes #6319
check_for_updates()inhermes_cli/banner.pypreferred~/.hermes/hermes-agentover the project root. When a user installs from source at a different location and a stale clone lives at~/.hermes/hermes-agent,hermes --versionperpetually reported "N commits behind" even after updating the live checkout.This patch resolves the repo directory against the project root (where
__file__lives) first, and only falls back to~/.hermes/hermes-agentwhen the project root isn't a git checkout (e.g. pip-installed wheel). Minimal change, preserves existing caching and fetch behavior.