Skip to content

V0.11.2/chore - #46

Closed
gimlichael wants to merge 3 commits into
mainfrom
v0.11.2/chore
Closed

gimlichael wants to merge 3 commits into
mainfrom
v0.11.2/chore

Conversation

@gimlichael

Copy link
Copy Markdown
Member

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:

  • Preview a normal push to origin or the sole GitHub remote under the current branch name, including upstream tracking when it is absent.
  • Bind tracking intent into the approval plan and verify the remote, branch, and tracking state after the push before writing PR metadata.
  • Keep ambiguous remotes, partial tracking, and mismatched branch names fail-closed, with regression coverage for first publication and existing remote branches.

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.
@gimlichael gimlichael self-assigned this Oct 2, 2026
@greptile-apps

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Medium risk] Updates pull request workflow to handle untracked branches.

The PR should not merge until first publication verifies the repository that will actually receive the push.

Fix All in CodexFindings

  1. P1 Push targets a different repository ▶
Fix with agent prompt
### Issue 1
skills/git-remote-pr/scripts/prepare-pr.ps1:34
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.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

The PR enables a clean branch without upstream tracking to be previewed, published with tracking, and used as a PR head. It also binds that tracking write to approval and adds first-publication regression cases.

  • The publication path needs to verify the remote’s effective push destination, not only its read URL.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Clean branch without tracking] --> B[Resolve head from remote URL]
  B --> C[Preview and approve]
  C --> D[Push with upstream tracking]
  D --> E[Verify remote SHA and tracking]
  E --> F[Create or update PR]
Loading

Reviews (1) · Last reviewed commit: "🔨 support first-push publication"

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' }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

Fix in Codex

@gimlichael gimlichael closed this Oct 3, 2026
@gimlichael
gimlichael deleted the v0.11.2/chore branch October 3, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants