What's the best practice of merging commits in maintenance branch to master in Gerrit

StackOverflow https://stackoverflow.com/questions/8411072

  •  29-10-2019
  •  | 
  •  

Question

Our project is using Gerrit for code review. Currently we're mainly working on master branch for next release and a maintenance branch.

I'm wondering what the best practice of merging commits in maintenance branch to master is. Do I have to push those commits already in maintenance branch one by one, and go through the code review process again?

Was it helpful?

Solution

There are 2 basic options:

  1. Cherry-pick your commits from maintenance to master, and push them through gerrit. On my team, we generally are less thorough on those code reviews because they've already been reviewed once. Generally a simple compile-check is sufficient.
  2. Merge the maintenance branch with the master branch and push this merge commit to gerrit. This is generally a better solution, especially if you want all of the changes in maintenance applied to master.

With merge commits, git can do a better job of showing you how the branches relate. It has more meta data so future merges are easier. The one downside to merge commits is that they aren't displayed that well in Gerrit currently, and generally developers have to look through the merge commit locally using git tools to truly understand what is going on.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top