feat: ez fork command for fork-based workflow#3
Open
dezren39 wants to merge 11 commits into
Open
Conversation
This was referenced Apr 12, 2026
Adds ez fork to configure push remote and PR target repo. gh pr create now passes --repo when state.repo is set, enabling fork workflows where you push to your fork but PRs target upstream.
…nd per-branch push_remote Add _in_repo variants for all gh PR operations (view/edit/base/body/ready/merge). Add cross_fork_head() to compute owner:branch head for cross-fork PRs. Add BranchMeta.push_remote field for per-branch push remote override. Add default_remote(), tracking_remote(), remote_owner() git helpers. Add StackState.effective_push_remote() chain: branch.push_remote > git tracking > state.remote > git default. Wire effective_repo through push_or_update_pr for all gh calls. Use effective_push_remote in push::run and submit::run.
…umber smart parsing Add --branch flag to config get/set (bare --branch = current branch). Auto-detect branch attrs (pr, pr_repo, pr_number, push_remote, scope, scope_mode, parent). Support branch. prefix: ez config branch.pr_repo owner/repo. Smart pr parser: 123, #123, owner/repo#123, URL all work. pr_repo prepends current owner if no slash (except pure numbers). remote --branch becomes per-branch push_remote. 20 new tests for parsing, classification, and branch value set/get.
…es, owners, and names Resolve bare names like 'asd#123' by checking: 1. Git remote named 'asd' → extract owner/repo from URL 2. Remote whose URL owner matches 'asd' → use that remote's repo 3. Prepend current repo owner → currentowner/asd 4. Return as-is if unresolvable Wire into config pr and pr_repo parsing (replaces local normalize_repo). Pure numbers bypass resolution (literal repo names). 4 new tests for shorthand resolution.
Add StackState::effective_pr_repo() to resolve per-branch PR target repo (branch.pr_repo > state.repo > None). Wire _in_repo variants into all 12 remaining command files: merge, pr_edit, draft, pr_view, delete, move_branch, status, log, pr_link, checkout, list, and sync. Add _in_repo variants for batch functions (get_all_pr_statuses, get_all_ci_statuses, get_ci_status). Normalize --repo via resolve_repo_shorthand in push.rs. 240 tests passing.
effective_push_remote now walks up the parent chain before falling back to git tracking remote, default branch remote, state.remote, or git default. effective_pr_repo derives from parent push remote URL (where the base ref lives) instead of parent pr_repo. Tests use CwdGuard with temp repos to isolate from real remotes.
888cbdc to
f6adc25
Compare
This was referenced Apr 13, 2026
Open
rohoswagger
added a commit
that referenced
this pull request
May 7, 2026
feat: add ez adopt — reconstruct stack from GitHub PR graph
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.
Adds fork-based workflow support:
ez forkcommand,--repo/--remoteflags on push/submit, cross-fork PR detection, and per-branch push remote/PR repo inheritance through the stack.Changes
ez fork— forks upstream viagh, adds remote, configuresstack.json--remote— custom remote name (default:fork)--from user— add someone else's fork--repoflag onez push/ez submit— target a specific repo for PR creationowner/repo--remoteflag onez push/ez submit— push to a specific git remoteeffective_push_remoteez config set branch.<name>.pr— smart parsing of PR URLs,#N,owner/repo#Nez config set branch.<name>.push_remote— per-branch push remote overrideget_pr_status_in_reporetries with fork-prefixed head (dezren39:feat/config) when bare branch name failseffective_push_remoteandeffective_pr_repowalk parent chain for push remote and PR repo resolutionremote_exists,remote_url,remote_owner,add_remote,rename_branch,update_branch_refrepo_name_from_url,resolve_repo_shorthand,cross_fork_headCommits (11)
7419588feat: add ez fork command for fork-based workflowa554bd9test: add remote_exists, add_remote, and remote_url git helper tests8eaf887feat: add --repo flag to push and submit for per-command PR target override2fa335efeat: persist pr_repo per-branch so future pushes reuse the target repoa8d9081fix: pr_repo resolution order — stored beats config, only store on explicit --repoce24126feat: wire pr_repo through all gh calls, add cross-fork head prefix and per-branch push_remote6668c1efeat: ez config branch attr detection, --branch flag, pr/pr_repo/pr_number smart parsingc547826feat: add resolve_repo_shorthand for smart repo resolution from remotes, owners, and namesca3a08efeat: make all PR commands fork-aware with effective_pr_repo helperd31322efeat: walk stack for push remote and PR repo inheritancec9f9b72chore: remove unused effective_remote methodResolves rohoswagger#4
Stack (this PR is 4 of 5):