Commit 269d73c
Skip pack push for branches fully subsumed by trunk
When trunk is planned first, its ancestry set already tells us which
branches contain no new commits — their tip is already reachable from
trunk, so trunk's batches have delivered every object those branches
need. Previously those branches still ran the full checkpoint machinery:
a commit-graph fetch (usually near-empty), a pack fetch (usually
near-empty), a temp-ref push, a cutover push, and a temp-ref delete.
With this change, the subsumed case is detected in planBatches before the
commit-graph fetch, and the resulting plannedBatch carries a subsumed
flag instead of checkpoints. executeBatched handles that flag with a
single ref-create PushCommand that points at the source hash — no fetch,
no pack, no temp ref, no cutover dance.
Correctness rests on trunkStopSet containing every commit reachable from
the trunk tip, not just the first-parent chain. collectCommitHashes
iterates all CommitObjects in the tree:0 fetch result, so merges and
their ancestors are included. A branch tip is therefore only marked
subsumed when its entire history is already covered by trunk's batches.
Added TestExecuteBatchedSubsumedBranchSkipsPack verifies that for a
feature branch pointing at an older commit on trunk's chain, the planner
emits zero commit-graph fetches and zero pack fetches for that branch,
and the executor issues only a single ref-create via PushCommands.
Webhook-count note: GitHub fires one push event per ref update, so the
subsumed branch still generates one webhook when its ref is created.
This change cuts the per-branch HTTP round-trips and object transfer for
that branch, not the webhook event itself. Operators concerned about
webhook volume during bulk migrations should still disable target
webhooks for the duration of the run.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 4cb744e146121 parent 5ce21fc commit 269d73c
2 files changed
Lines changed: 126 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
82 | 88 | | |
83 | 89 | | |
84 | 90 | | |
| |||
219 | 225 | | |
220 | 226 | | |
221 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
222 | 244 | | |
223 | 245 | | |
224 | 246 | | |
| |||
429 | 451 | | |
430 | 452 | | |
431 | 453 | | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
432 | 476 | | |
433 | 477 | | |
434 | 478 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
454 | 536 | | |
455 | 537 | | |
456 | 538 | | |
| |||
0 commit comments