git workflow suggestion for Bazel repo: avoid cherry-pick when prepping a new release
See original GitHub issueDescription of the problem / feature request / question:
It seems that that Bazel team’s current git workflow is: When a new release is almost ready, make a branch for that release; then, as necessary, cherry-pick last-minute fixes from master
into that branch, until the release is done.
My org has a fork of Bazel with some changes of our own, and the cherry-picking makes it very hard for us to move from one version of Bazel to the next, because we can’t git merge
. (At least, I think it’s the cherry-picks that are causing all the conflicts.)
I think that it might work better to turn your workflow around: When you have a change that needs to be in the upcoming release, first commit it to the release branch, and then merge (not cherry-pick) the release branch into master
.
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
034 Avoid Multiple Cherry-Picks using Git Flow - YouTube
In this video we go through a simple release /dev/hotfix branching strategy based on git - cherry-pick and then show an alternative approach ......
Read more >The case against `git cherry pick`: Recommended branching ...
Create a new feature branch directly from the main branch; Make changes on said feature branch; Test locally; When ready, open a pull...
Read more >gerrit - Git at Google
-1,13 +1,15 @@ = Gerrit Code Review - Building with Bazel ... tools/version.py` script and provide the new version as parameter, e.g.: ----...
Read more >Change log for 4.10.16
Changes from 4.9.0 · Components · New images · Removed images · Rebuilt images without code change · aws-cloud-controller-manager · aws-ebs-csi-driver.
Read more >Gitiles - GerritHub.io
Git repositories on review.gerrithub.io ... repository of the code which runs the new CA's for AfricaGridAAROC/DevOpsAnsible playbooks that ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Here’s a concrete example of the sort of merge conflicts that I’ve been getting. Try this — start at version 0.4.5 and then try to “merge” to get up to version 0.5.0, with no custom changes at all:
That’s a pretty simple series of commands, and I would think it would work; yet it results in merge conflicts in 36 files.
If you take a look at the conflict in CHANGELOG.md, you’ll see that git can’t resolve the “conflict”, because the 0.4.5 version has the description of 0.4.5; the 0.5.0 version has that plus the description of 0.5.0; and the merge-base has neither. If
git merge
was being used instead of cherry-picking, git would have been able to figure out what to do.I did eventually figure out a workaround: I
git merge
twice. First, Igit merge
only up to the commit onmaster
that corresponds directly to the corresponding head of 0.4.5; then Igit merge
again the rest of the way. That way, most of the changes that git sees in the firstgit merge
are identical on both sides. Like this:I guess we can close this issue now, feel free to shout at me otherwise 😃