Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Refuse a push of a branch whose pull request contains another open pull request - #1215

Draft
dfed wants to merge 2 commits into
mainfrom
claude/stacked-pull-request-check
Draft

dfed wants to merge 2 commits into
mainfrom
claude/stacked-pull-request-check

Conversation

@dfed

@dfed dfed commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Summary

A pull request that builds on an open pull request takes that one's branch as its base, lands after it and never contains it, so that its diff shows only its own change. Two changes that must land together are one pull request from the start. A pull request based on main that holds another's commits lands both in one squash commit under one title and leaves the other open with nothing to add.

Scripts/stacked-pull-request-check.py checks this. With no argument it reads the branch checked out, and exits 1 when that branch has an open pull request that holds the head commit of another open pull request and is not based on that one's branch; for a branch with no pull request yet it names the base its pull request must take. --all checks every open pull request as GitHub has it. The push hook Claude Code runs (.claude/hooks/lint-before-push.sh) calls it after lint and blocks the push at exit 1. When GitHub cannot be read the push goes through with a line that the check did not run.

Generated output: unchanged

Tests

The script's self-test holds eight cases on stand-in pull requests: one on main that holds another's head fails, one based on the pull request it holds passes, a branch with no pull request is told which base to take, and a stack of three is judged by its outermost base. CI runs it beside the other script self-tests. The hook was run by hand against a branch that breaks the rule, and blocked it.

Found and not fixed

  • The git hook (.claude/hooks/pre-push) does not run the check. Left: it runs in clones where no GitHub token may be present, and its self-test pushes between stand-in clones that have no pull requests.

Generated by Claude Code

…ll request

A pull request based on main that was built on another open pull request lands both changes in one squash commit
under one title and leaves the other open with nothing to add. Scripts/stacked-pull-request-check.py finds a branch
whose open pull request holds the head commit of another and is not based on that one's branch, and the push hook
runs it on the branch being pushed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HLuVQLHq43QvdYBYGWTdSo
@dfed dfed self-assigned this Dec 2, 2026
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Timing of 685a9a7

Wall times measured in this run. A wall time, peak memory, size or growth row over its limit is reported here and fails no check; a shape the tool cannot generate still fails "Check Generate Time on Linux". Every run rewrites this comment, and a check that did not run in it is not listed.

generate, head against base: 0 failure(s).

Every shape and row

generate time and peak memory, head against base: median of 5 alternating runs; a shape fails at 2 times the base's wall time or 1.3 times its peak memory, there or on the median peak of 5 more runs with one allocator arena, and C1500-mock-chain, E32-inline-mocks, S12-mocks, S16 at 1.1 times with one arena. APP100x800x3, APP300x3000x3, E24-public-mock, MR20x1000-many-roots, ORD400-ordinary are compared on their runs with one arena alone, at 1.3 or at the shape's own memory limit.

Shape Runs Base wall / CPU Head wall / CPU Head / base (wall) Base peak Head peak Head / base (peak) Generated code Verdict
every shape 0 not compared: the head tool is the base tool

.safedi size, head against base: a module fails at 2 times the base's bytes.

Shape Module Base bytes Head bytes Head / base Verdict

Growth, the head tool alone: each row at its layers and at 2 more, or at the two numbers it names; median of 3 alternating runs for time, and of 3 more with one allocator arena for peak memory. A measure fails at 2 times the smaller graph's, or at the limit beside it.

Row Layers Wall: fewer layers, more, ratio Peak memory .safedi bytes Generated code Verdict
P-seam-hole-at-every-screen 6 and 8 0.240 s, 1.925 s, 8.02 (limit 13) 60.4 MB, 198.5 MB, 3.29 (limit 5.5) 291416 bytes, 3379022 bytes, 11.60 (limit 12.5) 80978 bytes, 123266 bytes, 1.52 within the limits
L-label-declared-again 9 and 11 0.046 s, 0.050 s, 1.10 47.7 MB, 48.3 MB, 1.01 10443 bytes, 12982 bytes, 1.24 17699 bytes, 22475 bytes, 1.27 within the limits
K-mock-at-every-screen 6 and 8 0.088 s, 0.268 s, 3.03 (limit 6.5) 52.1 MB, 82.0 MB, 1.58 3135 bytes, 4255 bytes, 1.36 972037 bytes, 9574045 bytes, 9.85 (limit 10.5) within the limits
M-public-mock-layers 6 and 8 0.097 s, 0.274 s, 2.82 (limit 5) 50.7 MB, 58.1 MB, 1.15 6955 bytes, 9179 bytes, 1.32 428063 bytes, 3552741 bytes, 8.30 (limit 9) within the limits
MH-public-mock-hole-at-every-screen 6 and 8 0.225 s, 1.727 s, 7.68 (limit 12.5) 61.9 MB, 183.2 MB, 2.96 (limit 5.5) 224758 bytes, 2506094 bytes, 11.15 (limit 12.5) 751871 bytes, 6212036 bytes, 8.26 (limit 9) within the limits
Q-seam-own-module-paths 9 and 11 0.085 s, 0.107 s, 1.26 48.6 MB, 49.2 MB, 1.01 10422 bytes, 12665 bytes, 1.22 59796 bytes, 75892 bytes, 1.27 within the limits
B-cycles-through-instantiators 3 and 5 0.058 s, 0.060 s, 1.04 (limit 27) 46.0 MB, 46.2 MB, 1.00 (limit 3.6) 1706 bytes, 2680 bytes, 1.57 4492 bytes, 7990 bytes, 1.78 within the limits
W-ring-of-screens-that-open-each-other 10 and 12 0.033 s, 0.034 s, 1.04 (limit 4) 45.9 MB, 46.1 MB, 1.00 2498 bytes, 2962 bytes, 1.19 7147 bytes, 8555 bytes, 1.20 within the limits
WL-ring-of-screens-receiving-labels 2 and 4 0.202 s, 0.569 s, 2.81 (limit 5.5) 62.8 MB, 99.6 MB, 1.59 (limit 2.4) 46751 bytes, 60851 bytes, 1.30 50201 bytes, 76701 bytes, 1.53 within the limits
BM-mocks-of-cycles-through-instantiators 2 and 4 0.073 s, 2.054 s, 27.99 (limit 48) 49.9 MB, 166.6 MB, 3.34 (limit 6.5) 1262 bytes, 2221 bytes, 1.76 108891 bytes, 28647642 bytes, 263.09 (limit 275) within the limits
F9-public-mock-seam-chain 3 and 5 0.254 s, 2.447 s, 9.64 (limit 16) 53.9 MB, 203.2 MB, 3.77 (limit 6) 108330 bytes, 3474647 bytes, 32.07 (limit 36) 279360 bytes, 4961431 bytes, 17.76 (limit 19) within the limits
H-seam-holes-in-cycles 3 and 5 0.106 s, 1.485 s, 14.01 (limit 22) 48.3 MB, 88.9 MB, 1.84 (limit 2.6) 22299 bytes, 1376085 bytes, 61.71 (limit 65) 28228 bytes, 121080 bytes, 4.29 (limit 5) within the limits
TA-all-to-all-tangle 4 and 6 0.118 s, 2.156 s, 18.24 (limit 27) 49.9 MB, 163.8 MB, 3.28 (limit 4.7) 32535 bytes, 1247861 bytes, 38.35 (limit 47) 78851 bytes, 5566907 bytes, 70.60 (limit 83) within the limits
LS-layered-screens-opening-screen-above 6 and 8 0.039 s, 0.042 s, 1.08 46.5 MB, 46.8 MB, 1.01 3824 bytes, 5040 bytes, 1.32 11776 bytes, 15982 bytes, 1.36 within the limits
LST-layered-screens-opening-screen-above-over-twin-cycle 4 and 6 0.056 s, 0.515 s, 9.12 (limit 13) 48.7 MB, 79.8 MB, 1.64 1358 bytes, 1811 bytes, 1.33 3427 bytes, 4893 bytes, 1.43 within the limits
LSH-seam-layered-screens-opening-screen-above-hole-at-leaves 3 and 5 0.135 s, 1.874 s, 13.85 (limit 26) 50.2 MB, 140.7 MB, 2.81 (limit 4.5) 29722 bytes, 1005186 bytes, 33.82 (limit 38) 79021 bytes, 3078304 bytes, 38.96 (limit 47) within the limits
O-only-if-available-at-every-screen 6 and 8 0.036 s, 0.038 s, 1.06 46.2 MB, 46.4 MB, 1.00 3364 bytes, 4438 bytes, 1.32 9413 bytes, 12671 bytes, 1.35 within the limits
R-received-instantiator-at-every-screen 6 and 8 0.038 s, 0.041 s, 1.09 46.1 MB, 46.5 MB, 1.01 3230 bytes, 4316 bytes, 1.34 21143 bytes, 31547 bytes, 1.49 within the limits
N-rename-at-every-screen 8 and 10 0.038 s, 0.040 s, 1.06 46.8 MB, 47.1 MB, 1.01 4432 bytes, 5507 bytes, 1.24 13439 bytes, 16889 bytes, 1.26 within the limits
V-renames-in-alternate-layers 10 and 12 0.045 s, 0.047 s, 1.06 47.3 MB, 48.2 MB, 1.02 6952 bytes, 8388 bytes, 1.21 22258 bytes, 27706 bytes, 1.24 within the limits
VO-only-if-available-renames-in-alternate-layers 10 and 12 0.044 s, 0.048 s, 1.10 47.6 MB, 47.9 MB, 1.01 7027 bytes, 8475 bytes, 1.21 22277 bytes, 27729 bytes, 1.24 within the limits
PR-parents-router 8 and 10 0.050 s, 0.040 s, 0.81 46.3 MB, 46.6 MB, 1.01 4300 bytes, 5373 bytes, 1.25 15705 bytes, 19869 bytes, 1.27 within the limits
PRS-seam-parents-router 8 and 10 0.077 s, 0.082 s, 1.07 47.3 MB, 47.1 MB, 1.00 7954 bytes, 9849 bytes, 1.24 17103 bytes, 21357 bytes, 1.25 within the limits
T-leaves-reached-twice-at-depth 1 and 3 0.373 s, 1.156 s, 3.10 (limit 6) 84.3 MB, 161.4 MB, 1.91 (limit 3.8) 214719 bytes, 665319 bytes, 3.10 (limit 3.5) 419959 bytes, 1288909 bytes, 3.07 (limit 3.5) within the limits
CH-chain-of-instantiators 1000 and 2000 0.199 s, 0.409 s, 2.05 (limit 2.3) 65.6 MB, 85.6 MB, 1.31 (limit 2.3) 107683 bytes, 219498 bytes, 2.04 (limit 2.3) 207492 bytes, 423492 bytes, 2.04 (limit 2.3) within the limits
RG-ring-of-instantiators 1000 and 2000 0.235 s, 0.520 s, 2.21 (limit 2.3) 66.3 MB, 89.6 MB, 1.35 (limit 2.3) 112707 bytes, 229523 bytes, 2.04 (limit 2.3) 234611 bytes, 477611 bytes, 2.04 (limit 2.3) within the limits
DC-chain-of-declarations-at-depth 2 and 4 0.613 s, 1.251 s, 2.04 (limit 2.3) 104.8 MB, 165.3 MB, 1.58 (limit 2.3) 341402 bytes, 693402 bytes, 2.03 (limit 2.3) 703337 bytes, 1415337 bytes, 2.01 (limit 2.3) within the limits
LC-chain-inside-lazy-cycle-function 2 and 4 0.976 s, 2.169 s, 2.22 (limit 3.2) 145.4 MB, 245.5 MB, 1.69 (limit 2.3) 565618 bytes, 1174902 bytes, 2.08 (limit 2.3) 1182142 bytes, 2394938 bytes, 2.03 (limit 2.3) within the limits
DL-deep-lazy-cycle 300 and 600 0.071 s, 0.117 s, 1.66 (limit 2.3) 50.5 MB, 54.7 MB, 1.08 (limit 2.3) 24944 bytes, 50144 bytes, 2.01 (limit 2.3) 53193 bytes, 106593 bytes, 2.00 (limit 2.3) within the limits
TS-leaves-reached-from-two-screens 2 and 4 0.593 s, 1.235 s, 2.08 (limit 2.3) 105.6 MB, 163.7 MB, 1.55 (limit 2.8) 317851 bytes, 647451 bytes, 2.04 (limit 2.3) 565355 bytes, 1150955 bytes, 2.04 (limit 2.3) within the limits
TC-leaves-reached-three-times-down-chain 2 and 4 0.385 s, 0.762 s, 1.98 (limit 3.6) 82.9 MB, 120.5 MB, 1.45 (limit 2.1) 211144 bytes, 431644 bytes, 2.04 (limit 2.3) 455533 bytes, 915033 bytes, 2.01 (limit 2.3) within the limits
TW-components-on-two-wide-screens 2 and 4 0.770 s, 1.609 s, 2.09 (limit 2.5) 121.3 MB, 193.1 MB, 1.59 (limit 2.3) 440981 bytes, 875561 bytes, 1.99 (limit 2.3) 790823 bytes, 1558723 bytes, 1.97 (limit 2.3) within the limits
BL-back-links-to-feature-entries 1 and 3 0.043 s, 0.043 s, 1.01 47.1 MB, 47.2 MB, 1.00 7344 bytes, 7394 bytes, 1.01 25102 bytes, 25352 bytes, 1.01 within the limits
BL4-back-links-to-most-feature-entries 4 and 6 0.044 s, 0.044 s, 1.01 (limit 6) 47.3 MB, 47.2 MB, 1.00 (limit 2.4) 7425 bytes, 7475 bytes, 1.01 25477 bytes, 25727 bytes, 1.01 within the limits
BLO-back-links-with-state-only-if-available 1 and 3 0.057 s, 0.082 s, 1.44 (limit 8) 48.3 MB, 50.4 MB, 1.04 7409 bytes, 7459 bytes, 1.01 25156 bytes, 25406 bytes, 1.01 within the limits
BLS-back-links-with-feature-labels-over-shared-tree 1 and 3 0.465 s, 0.789 s, 1.70 106.1 MB, 141.6 MB, 1.33 (limit 2.3) 260378 bytes, 435233 bytes, 1.67 375861 bytes, 642061 bytes, 1.71 within the limits
MB-calling-mocks-of-many-hole-types 40 and 80 0.240 s, 0.491 s, 2.04 (limit 2.2) 58.2 MB, 67.0 MB, 1.15 36220 bytes, 69448 bytes, 1.92 2316408 bytes, 4639408 bytes, 2.00 (limit 2.2) within the limits
LP-lifelike-chain-under-the-plugin 5 and 10 0.418 s, 0.846 s, 2.02 (limit 2.35) 73.4 MB, 97.1 MB, 1.32 0 bytes, 0 bytes, 1.00 3542265 bytes, 6777708 bytes, 1.91 (limit 2.2) within the limits
LPB-lifelike-chain-with-back-edges 5 and 10 1.359 s, 2.737 s, 2.01 (limit 2.3) 141.6 MB, 227.5 MB, 1.61 (limit 2.3) 0 bytes, 0 bytes, 1.00 (limit 2.3) 15693355 bytes, 26376804 bytes, 1.68 (limit 2.3) within the limits

The compiler's time on single functions: 0 finding(s), reported and not failed.

The compiler's time on single functions of SafeDICore, release build.

Measure Function Time Limit Verdict
optimizing static SafeDICore.DependencyTreeGenerator.holes(of: SafeDICore.Instantiable, generator: SafeDICore.ScopeGenerator, bindsReceivesAgain: Swift.Bool, namesApartAtRoot: SafeDICore.DependencyTreeGenerator.PublicMockRootLevel.NamesApart, parameters: [SafeDICore.SeamSignature.Parameter], assembledPlaces: SafeDICore.SeamAssembledPlaces?, factsView: SafeDICore.SeamFactsView?, receiversByParameter: [SafeDICore.Property : [SafeDICore.SeamSignature.Receiver]], proof: SafeDICore.TypeAccessProof, instantiables: [SafeDICore.TypeDescription : SafeDICore.Instantiable]) -> SafeDICore.DependencyTreeGenerator.HolesAndPlaces (the longest within the limit) 2.7 s 10 s within the limit
type-checking instance method SafeDICore.(file).SeamPlacesDrafts extension.declarationListDifferences(from:parameters:) (SeamPlacesDrafting+Reentries.swift:69) (the longest within the limit) 3.4 s 5 s within the limit

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