fix(forgejo): auto-merge rebase fetches base into remote-tracking ref #61
No reviewers
Labels
No labels
adr
agent:blocked-ci
agent:blocked-human
agent:blocked-resolver
agent:done
agent:in-progress
agent:no-touch
agent:pinged
agent:pr-open
agent:queued
agent:wip
area:board
area:funding
area:infra
area:phy
area:poplink
area:rtl
area:software
area:supply-chain
area:verification
ci-failed
ci-timeout
docs
do-not-merge
human-approved
needs-human-approval
needs-rebase
needs-triage
phase:1
ready-for-review
review:findings
review:pass
risk:tripwire
swarm:quarantined
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Fluid/fluidpop-v1!61
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/auto-merge-rebase-refspec"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The rebase path added in #44 cloned with
--branch <head>(partial clone, nomainlocally), then rangit fetch origin mainandgit rebase origin/main. A plaingit fetch origin <ref>updatesFETCH_HEADbut does not createrefs/remotes/origin/<ref>in a partial clone where it didn't already exist — sogit rebase origin/maindied withfatal: invalid upstream 'origin/main'and the resolver gave up with exit 5.Reproduced on PR #59 (Chipyard install) and #60 (tapeout RFQ): both stuck
needs-rebasefor ~6 minutes with pr-approver kicking the same failure every 60s.Change
One-line: use an explicit refspec that targets the remote-tracking ref directly:
The
+allows non-fast-forward updates to the remote-tracking ref, matching the implicit behaviour of a default fetch refspec on a normal clone.Test plan
refs/remotes/origin/main,git rebase origin/mainsucceeded, force-push went through, merge HTTP 200.The previous rebase_and_push cloned with `--branch <head_ref>` (so the local repo only had the head branch), then ran `git fetch origin <base>`. A plain `git fetch origin <base>` updates FETCH_HEAD but does NOT create or update `refs/remotes/origin/<base>` when that remote-tracking ref doesn't already exist in the partial clone. The subsequent `git rebase origin/<base>` then died with: fatal: invalid upstream 'origin/main' Observed on PR #59 (Chipyard install) and #60 (tapeout RFQ docs) — both hit "behind base" on first attempt, both failed to rebase, both stayed needs-rebase and the pr-approver kicked the same exit-5 path every minute. Fix: explicit refspec on the fetch creates the remote-tracking ref unconditionally: git fetch origin "+refs/heads/<base>:refs/remotes/origin/<base>" The leading `+` allows non-fast-forward update of the remote-tracking ref, matching the implicit behaviour of a default fetch refspec.CI green (head
a514887689), auto-approvinga514887689bee1567798CI green (head
bee1567798), auto-approving