Skip to content

Commit 9ae64b7

Browse files
fix: better backport instructions (#168)
* fix: better backport instructions * cleaner Updated instructions for backporting conflicts in commands.py. * Update meeseeksdev/meeseeksbox/commands.py Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com> --------- Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
1 parent 6f9d58b commit 9ae64b7

1 file changed

Lines changed: 17 additions & 9 deletions

File tree

meeseeksdev/meeseeksbox/commands.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -884,34 +884,42 @@ def keen_stats():
884884
f"""Owee, I'm MrMeeseeks, Look at me.
885885
886886
There seem to be a conflict, please backport manually. Here are approximate instructions:
887+
They assume that the base project is the Git remote `upstream` and your fork is `origin`.
887888
888-
1. Checkout backport branch and update it.
889+
1. Update backport branch.
889890
890891
```
891-
git checkout {target_branch}
892-
git pull
892+
git fetch upstream {target_branch}:{target_branch}
893+
# or `git pull upstream {target_branch}` if you are on {target_branch}
893894
```
894895
895-
2. Cherry pick the first parent branch of the this PR on top of the older branch:
896+
2. Create PR branch.
897+
898+
```
899+
git switch -c {remote_submit_branch} {target_branch}
900+
```
901+
902+
3. Cherry pick the first parent branch of this PR on top of the older branch:
903+
896904
```
897905
git cherry-pick -x -m1 {merge_sha}
898906
```
899907
900-
3. You will likely have some merge/cherry-pick conflict here, fix them and commit:
908+
4. You will likely have some merge/cherry-pick conflict here, fix them and commit:
901909
902910
```
903911
git commit -am {msg!r}
904912
```
905913
906-
4. Push to a named branch:
914+
5. Push to a named branch:
907915
908916
```
909-
git push YOURFORK {target_branch}:{remote_submit_branch}
917+
git push --set-upstream origin {remote_submit_branch}
910918
```
911919
912-
5. Create a PR against branch {target_branch}, I would have named this PR:
920+
6. Create a PR against branch {target_branch}, I would have named this PR:
913921
914-
> "Backport PR #{prnumber} on branch {target_branch} ({prtitle})"
922+
> Backport PR #{prnumber} on branch {target_branch} ({prtitle})
915923
916924
And apply the correct labels and milestones.
917925

0 commit comments

Comments
 (0)