V0.11.2/chore - #46
gimlichael wants to merge 3 commits into
Conversation
Explain how untracked branches are published and how upstream tracking is established during PR execution.
Allow a clean branch without tracking to prepare an explicit first-publication plan, while preserving fail-closed handling for ambiguous remotes and mismatched tracking.
Let the approved first-publication plan push an untracked branch and establish its upstream, with deterministic coverage for remote selection, plan binding, and post-push checks.
|
| throw "Local branch '$branch' does not match upstream tracking branch '$upstreamRemote/$remoteBranch'. This usually means a local rename left tracking stale or the remote branch still uses the old name. Update tracking with: git branch --set-upstream-to=$upstreamRemote/$branch after the remote branch name is corrected. If the remote still needs the renamed branch, publish it first with: git push $upstreamRemote HEAD:refs/heads/$branch" | ||
| $setUpstreamRequired = -not $upstreamRemote -and -not $mergeRef | ||
| if ($setUpstreamRequired) { | ||
| if ($remoteRepos.ContainsKey('origin')) { $headRemote = 'origin' } |
There was a problem hiding this comment.
Push targets a different repository
If origin has a pushurl pointing to repository B while its url points to repository A, preparation shows A as the PR head, but git push origin publishes the branch to B. The SHA check against A fails only after the unintended push. Verify the effective push destination before approving first publication, or reject a remote whose push destination differs from the resolved head repository.
Knowledge Base Used: Remote pull request workflows
Prompt To Fix With AI
This is a comment left during a code review.
Path: skills/git-remote-pr/scripts/prepare-pr.ps1
Line: 34
Comment:
**Push targets a different repository**
If `origin` has a `pushurl` pointing to repository B while its `url` points to repository A, preparation shows A as the PR head, but `git push origin` publishes the branch to B. The SHA check against A fails only after the unintended push. Verify the effective push destination before approving first publication, or reject a remote whose push destination differs from the resolved head repository.
**Knowledge Base Used:** [Remote pull request workflows](https://app.greptile.com/geekle/-/custom-context/knowledge-base/codebeltnet/agentic/-/docs/git-remote-pull-requests.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
This pull request lets a clean feature branch with no upstream tracking proceed through the reviewed first-publication flow. Execution publishes the approved branch to the resolved GitHub remote, establishes tracking, and verifies the result before creating the PR.
First publication:
originor the sole GitHub remote under the current branch name, including upstream tracking when it is absent.