Commit f65bfd3
fix(publish): force-with-lease when re-publishing a rebuilt bundle (#108)
The new-PR path builds the contribution with `checkout -B <branch> origin/<base>`
→ apply → commit → `git push -u origin <branch>` (a plain push). After
`signoff --iterate-do` rebuilds Do off the current base, that fresh commit is a
sibling of the previous attempt already on the PR branch, not a fast-forward, so the
plain push is rejected ("non-fast-forward") — the bundle is left COMPLETE but NOT
published, and the operator must force-push by hand.
Push with `--force-with-lease`. A deliberately-rebuilt branch is exactly when a force
update is intended; the lease keeps it safe — the preceding `git fetch` refreshes
`origin/<branch>`, so the push refuses if the remote moved unexpectedly, and it still
creates the branch on a first publish (verified: force-with-lease on an absent remote
ref is a normal create). Stack mode is untouched: it appends `HEAD:<branch>`, a
fast-forward, so its plain push is correct.
Regression test (real git, bare origin + clone): two publishes of distinct fixes off
the same base — the second is non-ff; it was rejected (rc=1) before this change and
now force-updates the PR branch to the rebuilt commit. Full offline suite: 165 OK.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Eduard Ralph <15236434+eduralph@users.noreply.github.com>1 parent 51a17c8 commit f65bfd3
2 files changed
Lines changed: 47 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
155 | 162 | | |
156 | 163 | | |
157 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
232 | 271 | | |
233 | 272 | | |
234 | 273 | | |
| |||
0 commit comments