summaryrefslogtreecommitdiff
path: root/contrib/persistent-https
diff options
context:
space:
mode:
authorKristofer Karlsson <krka@spotify.com>2026-08-11 09:28:50 +0000
committerJunio C Hamano <gitster@pobox.com>2026-08-11 07:34:32 -0700
commit02d7ba092deee118bb3954077880abfdc8f2dc2f (patch)
tree4e7ccb3570f383f24191b781ee05e7f678e3ca8e /contrib/persistent-https
parenta3e5bad734f8f83a485c5f28535d1f409993a175 (diff)
commit-reach: terminate merge-base walk when one paint side is exhausted
Add an early termination check to paint_down_to_common() using the per-side counters introduced earlier. Once the walk enters the ordered region, terminate early when one side's exclusive count drops to zero -- no new merge-base can form without both paint sides meeting. The check also waits for pending_merge_bases to reach zero, ensuring all merge-base candidates have been dequeued and recorded before exiting. The optimization is gated by gen_ordered (which excludes v1 commit-graphs that use the date-ordering fallback) and by a generation check against topo_ceiling. topo_ceiling is GENERATION_NUMBER_INFINITY for v2 graphs and GENERATION_NUMBER_V1_MAX for v1 graphs, so that saturated commits are treated as unordered. Together these ensure the check only fires in the ordered region where topological ordering holds. The same topo_ceiling boundary is applied to the existing single-result early exit so that all generation-dependent gates express the same saturation-aware boundary consistently. Step counts measured with trace2 on git.git with commit-graph: merge-base --all v2.0.0 v2.55.0-rc1: before: 72264 steps after: 44589 steps merge-base --all v2.55.0-rc1 v2.55.0-rc1~5: before: 110 steps after: 7 steps Helped-by: Derrick Stolee <stolee@gmail.com> Helped-by: Elijah Newren <newren@gmail.com> Signed-off-by: Kristofer Karlsson <krka@spotify.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/persistent-https')
0 files changed, 0 insertions, 0 deletions