You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove unnecessary PR updates for indirect children (#23)
* Remove indirect children updates - diffs stay correct without them
The action now only updates direct children of a merged PR. Indirect
descendants (grandchildren, etc.) are intentionally not modified.
This simplification is possible because:
- PR diffs remain correct without updating indirect children
- The merge-base calculation still works correctly since the synthetic
merge commit includes the original parent commit as an ancestor
- Indirect children become direct children when their parent is merged,
at which point they get updated properly
Benefits:
- Simpler code: removed ~140 lines
- Fewer API calls and git operations
- No risk of cascading merge conflicts through the stack
- Clearer mental model: each merge only affects direct children
The e2e tests still verify that indirect children's diffs remain correct
after their grandparent is merged.
* Clean up unit tests: remove dead code, add actual verification
- Remove unused simulate_delete_remote_branch() helper function
- Actually verify feature3 wasn't modified instead of just logging
* Fix outdated comment about feature4 purpose in e2e test
---------
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,11 +17,12 @@ This action tries to fix that in a transparent way. Install it, and hopefully th
17
17
### How it works
18
18
19
19
1. Triggers when a PR is squash merged
20
-
2. Finds PRs that were based on the merged branch
21
-
3. For direct children: creates a synthetic merge commit with three parents (child tip, deleted branch tip, squash commit) to preserve history without re-introducing code
22
-
4. For indirect descendants: merges the updated parent branch
23
-
5. Updates the direct child PRs to base on trunk now that the bottom change has landed; higher PRs stay based on their parent
24
-
6. Force-pushes updated branches and deletes the merged branch
20
+
2. Finds PRs that were based on the merged branch (direct children only)
21
+
3. Creates a synthetic merge commit with three parents (child tip, deleted branch tip, squash commit) to preserve history without re-introducing code
22
+
4. Updates the direct child PRs to base on trunk now that the bottom change has landed
23
+
5. Force-pushes updated branches and deletes the merged branch
24
+
25
+
**Note:** Indirect descendants (grandchildren, etc.) are intentionally not modified. Their PR diffs remain correct because the merge-base calculation still works—the synthetic merge commit includes the original parent commit as an ancestor. When their direct parent is eventually merged, they become direct children and get updated at that point.
25
26
26
27
### Conflict handling
27
28
@@ -38,7 +39,6 @@ After you manually resolve the conflict and push:
38
39
2. The action detects the conflict label and removes it
39
40
3. Updates the PR's base branch to trunk
40
41
4. Deletes the old base branch (if no other conflicted PRs still depend on it)
41
-
5. Continues updating any dependent PRs in the stack
0 commit comments