-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: add a script to merge a PR according to our current workflow #868
Conversation
# ensure that the branch is at the tip of `origin/main` for a linear history | ||
git fetch | ||
git checkout "$branch" | ||
if ! git rebase origin/main; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a prime use case for git merge-base ---is-ancestor
. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, I was looking for something like that, but google wasn't helpful. I think this behavior, which does the rebase as a side-effect, is actually better though.
There are 3 cases we care about:
- The branch already originates from
origin/main
- The branch originates from some older commit than
origin/main
but applies cleanly. - The branch originates from some older commit than
origin/main
but does not apply cleanly.
git merge-base --is-ancestor
will do a great job distinguishing case 1, but conflates cases 2 and 3. We do want to distinguish between those.
git rebase
as written here conflates 1 and 2, but distinguishes case 3; I think that's the behavior we actually want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, with a few smaller things.
753e491
to
993a743
Compare
We have decided to require both signed commits and a linear history in github, which breaks the github "merge" button completely. This script does the right thing to accomplish signed commits with a linear history, because it's kind of a pain to do manually each time.
993a743
to
815cc85
Compare
We have decided to require both signed commits and a linear history in github, which breaks the github "merge" button completely.
This script does the right thing to accomplish signed commits with a linear history, because it's kind of a pain to do manually each time.
What's new in this PR
PR Submission Checklist for internal contributors
SQPIT-764
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764
.