Reputation: 5852
We have created a release branch for our latest release. In the meantime, we have continued to work on new features on master.
We have continuously made bug fixes on the release branch. Typically we create a topic branch based on the release branch, fix the bug on the topic branch, and merge it to the release branch when done.
After this, we cherry-pick the merge commit from the release branch to master.
Now to the issue: We have quite a few bug fixes and it is starting to get hard to make sure that they are all cherry-picked. Is there a way to verify that all the fixes on the release branch are also included in master?
Upvotes: 1
Views: 360
Reputation: 5852
After some further investigation, I found the answer to my question in a git command that I did not know existed.
git cherry
does the job. The docs say: "The equivalence test is based on the diff, after removing whitespace and line numbers." which can be quite useful.
To check if the same commits exist in master as the release branch you can run the following command:
$ git cherry master <your_release_branch>
Upvotes: 0
Reputation: 311823
If you cherry-pick a patch from one branch to another it will get a different commit hash, so you can't rely on that.
I'd suggest having your own key at the beginning of your commit message (e.g., "Bug-12345 Fix memory leak in SomeComponent"). Then, you could extract the list of bug fixes from each branch, e.g.:
$ git log --oneline <branchname> | grep '^Bug-' | sort
and then compare the two.
Upvotes: 3