Repository navigation
Conversation
ktravers
marked this pull request as ready for review
October 20, 2026 16:27
ktravers
requested review from
Lukeghenco,
francisfuzz,
georgebrock and
wiseemily88
and
a balanced review from Copilot
October 20, 2026 16:27
Lukeghenco
approved these changes
Oct 20, 2026
skarim
approved these changes
Oct 20, 2026
skarim
left a comment
Collaborator
There was a problem hiding this comment.
lgtm! applying the flag on all force pushes (but not non-force pushes) makes sense to me ✅
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Force pushes discard configured push options, and localized Git errors bypass the fallback.
2 open issues
What changed in this PR
Adds a stacked-PR signal to force pushes, supporting approval retention after rebases that leave the PR diff unchanged.
Changes:
- Sends
pull.stackedon force pushes, with an unsupported-remote fallback. - Adds push-option integration tests and updates rebase fixtures.
| File | Description |
|---|---|
| internal/git/gitops.go | Adds the push option and fallback. |
| internal/git/gitops_test.go | Tests option delivery and unsupported remotes. |
| cmd/rebase_test.go | Enables push options in test remotes. |
Review effort: Balanced
| } | ||
| // Send the "pull.stacked" push option on force pushes, falling back to a | ||
| // plain push for remotes that don't support push options. | ||
| withOpt := append([]string{"push", "-o", "pull.stacked"}, args[1:]...) |
| // Send the "pull.stacked" push option on force pushes, falling back to a | ||
| // plain push for remotes that don't support push options. | ||
| withOpt := append([]string{"push", "-o", "pull.stacked"}, args[1:]...) | ||
| err := d.runSilent(withOpt...) |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR updates
git.Pushto send a push options argument (-o pull.stacked) on forced push only. Consumers can then read that argument as a signal that the ref update belongs to a stacked pull request and handle appropriately. Specifically, this will support retaining approving reviews on stacked pull requests after a rebase that doesn't change the diff (before and after diffs are "tree same").