Conversation
This was referenced Apr 14, 2025
dimikot
added a commit
that referenced
this pull request
Apr 14, 2025
…ng happened Pull Request: #31 (main)
1206f17 to
49e000c
Compare
dimikot
added a commit
that referenced
this pull request
Apr 14, 2025
…ng happened Pull Request: #31 (main)
dimikot
added a commit
that referenced
this pull request
Apr 14, 2025
…ng happened Pull Request: #31 (main)
49e000c to
db5f608
Compare
dimikot
added a commit
that referenced
this pull request
Apr 14, 2025
## Summary Adding an engine which is able to push multiple branches (commits) atomically. For now, it still does most of the pushes sequentially, but using the parallel engine (with commits list size 1). The problem is that multi-branch push can only be used safely when no commits reordering happened in the stack (otherwise, GitHub may mark some of intermediate PRs as merged prematurely, and there is no way out of it). That's why in the current PR, we do not utilize it much yet. It will be treated in the next PRs. ## How was this tested? CI. ## PRs in the Stack - #31 - #30 - ➡ #29 (The stack is managed by [git-grok](https://github.com/dimikot/git-grok).)
e7fe862 to
583b632
Compare
dimikot
added a commit
that referenced
this pull request
Apr 14, 2025
…ng happened Pull Request: #31 (main)
db5f608 to
fc58402
Compare
dimikot
added a commit
that referenced
this pull request
Apr 14, 2025
## Summary GitHub is "too smart", so sometimes it marks the PRs as merged or as closed on its own, right after the PR head branch is force-pushed: 1. If the head branch is force-pushed, and GitHub thinks that all the code is merged to the upstream already, it marks the PR as merged. 2. If the head branch is force-pushed the way the PR has 0 commits in it, GitHub closes that PR and makes it unopenable. 3. When the PR is closed anyhow, and then the head branch is force-pushed to some new commit hash, then GitHub refuses to reopen that PR (see isaacs/github#361 for details). We used to cover the case (1) (git-grok was just creating a new PR). Now we cover the case 2 (the same way as case 1) and case 3 (with a hack explained at isaacs/github#361). ## How was this tested? ``` git grok ``` All those PRs were closed, then randomly reordered, and git-grok rerun:  ## PRs in the Stack - #31 - ➡ #30 (The stack is managed by [git-grok](https://github.com/dimikot/git-grok).)
Base automatically changed from
grok/dimikot/improve-closed-prs-reopening-corner-cases-to-main-c887
to
main
April 14, 2025 10:35
…ng happened Pull Request: #31 (main)
fc58402 to
2b5dd24
Compare
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.
Summary
Git supports "atomic push" of multiple branches. We now use it in git-grok:
It is faster than pushing one by one.
It is possible that it improves CODEOWNERS-based reviewers addition when a large stack is reordered or rebased.
How was this tested?
CI (there was a test that covers the usecase with reordering).
PRs in the Stack
(The stack is managed by git-grok.)