Page 1 of 1

How to cherry pick?

Posted: Sun Mar 22, 2026 3:17 am
by mcarans
I have closed my PR (https://github.com/OoliteProject/oolite/pull/564) to bring changes from 1.92-maintenance due to the strong resistance to just copying over the changes.

I would like someone to explain clearly how to cherry pick as I am unfamiliar. Linking articles is not useful. What I need is an outline of the whole process with respect to our 1.92-maintenance branch as well as a step by step example with one of the commits on 1.92-maintenance showing all the git commands required to bring that commit into master and any gotchas to look out for.

Re: How to cherry pick?

Posted: Sun Mar 22, 2026 10:09 am
by another_commander
I would like to know this information too. And I think it would be so much simpler if the PR was just accepted.

Standing by. @mcarans, if no information is provided in a reasonable time, please consider reopening the PR.

Re: How to cherry pick?

Posted: Sun Mar 22, 2026 10:45 am
by hiran
I am happy to not have experience in cherry picking.

Looking at the fact that mcarans is the only one doing changes at this time I think a merge should be considered.

However I wanted to make a point that future PRs schould have one purpose each so they are difestable for reviewers.

Re: How to cherry pick?

Posted: Sun Mar 22, 2026 12:36 pm
by Lone_Wolf
First off : I have no personal experience with cherry-pick .

Yesterday I entered "git how to port multiple commits from one branch to another" into DDG and every result was about cherry-pick .
I do know that archlinux & mesa devs use cherry-picking so I felt mentioning it in the PR as an option was a good idea.

I am willing to spend time on figuring out how to use this and think I can create sort of a Proof of Concept by following these steps

track all commands used
Clone oolite to my workstation
Lookup the first PRs that added commits to 1.92-maintenance
git cherry-pick those commits to master
push the new version to a new sourcehut repo so others can see what has happened
post the commands used
repeat with a 2nd PR

Re: How to cherry pick?

Posted: Sun Mar 22, 2026 6:16 pm
by mcarans
Lone_Wolf wrote: Sun Mar 22, 2026 12:36 pm
First off : I have no personal experience with cherry-pick .

Yesterday I entered "git how to port multiple commits from one branch to another" into DDG and every result was about cherry-pick .
I do know that archlinux & mesa devs use cherry-picking so I felt mentioning it in the PR as an option was a good idea.

I am willing to spend time on figuring out how to use this and think I can create sort of a Proof of Concept by following these steps

track all commands used
Clone oolite to my workstation
Lookup the first PRs that added commits to 1.92-maintenance
git cherry-pick those commits to master
push the new version to a new sourcehut repo so others can see what has happened
post the commands used
repeat with a 2nd PR
Great! As you investigate, please can you find out about the following questions (I often find that the devil is in the details):
  1. Environment: Does cherry-picking need to be done on a clone of the original OoliteProject/oolite repo, or can it be done on a fork followed by a PR?
  2. Target Branch: What branch do we start in: master or 1.92-maintenance?
  3. Batching: Is it possible to specify a commit range, or must cherry-picking be done one commit at a time?
  4. Conflict Resolution: I'm interested in how conflict resolution works. Please pick commits that touch both Obj-C .m files and shell .sh scripts. The former may give conflicts.
  5. Workflow Order: For each cherry-pick (assuming more than one), what is the order?
    1. Cherry-pick 1, ..., cherry-pick N, resolve all conflicts, commit, push.
    2. Cherry-pick 1, resolve conflicts 1, ..., cherry-pick N, resolve conflicts N, commit, push.
    3. Cherry-pick 1, resolve conflicts 1, commit 1, ..., cherry-pick N, resolve conflicts N, commit N, push.
    4. Some other order.
  6. Verification: What do we expect to see in the commit history at the end of the process so we know it has been done correctly?