feat(cli): add --branch flag to hermes update - #29591
Merged
Merged
Conversation
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.
hermes updatehas always hard-coded its target tomain. Add --branch so callers can update against a non-default channel while preserving every existing behavior at the default:hermes updatestill pulls main (no behavior change)hermes update --branch Xpulls origin/X, auto-stashing and switchinglocal HEAD to X first if needed
hermes update --check --branch Xreports behindness againstorigin/X (and skips the upstream/X probe,
since forks don't have upstream copies of
their own feature branches)
checkout -B X origin/X(track)the user's prior stash so we don't strand
them in a weird state
The fork-upstream sync logic was already guarded on
branch == 'main', so non-main updates correctly skip the upstream trampling without further changes.5 new tests cover: explicit --branch, default-to-main, switch-from-other, track-from-origin, and the fail-cleanly case. Full test_cmd_update.py suite (15 tests) passes on main.