How can multiple parallel features be achieved in Gerrit?
I have several features which need to go in Gerrit for Code Review and until we have been working each developer pushes one feature and waits for it to pass code review if it needs to be fixed we patch it and wait until it passes the Code review (one feature at a time). But now the team that was doing code reviews got pretty small in members, so I have to wait 2 days for a code review. And based on the rules we set up when we started (which don't apply anymore, but I only know this workflow now), each developer can have only on commit at a time for code review in gerrit, I have to wait and not work on anything else until that commit has passed Code Review.
How can I bypass this and work pararelly in Gerrit? For example I have the local branch dev
and I have the remote gerrit branch refs/for/dev
now I push a feature that is commit A
, how do I push another commit, commit B
in the same branch refs/for/dev
without it showing up as a dependency in Gerrit?
And what will happen if for example the commit B
is merged but commit A
didn't pass code review and needs to be patched?
You need to work the commits in parallel, like this:
1) Create a branch for the first change
git fetch
git checkout -b change-1 origin/dev
2) Do the first change
<edit>
git add .
git commit
git push origin HEAD:refs/for/dev
3) Create a branch for the second change
git fetch
git checkout -b change-2 origin/dev
4) Do the second change
<edit>
git add .
git commit
git push origin HEAD:refs/for/dev
If you need to create another patchset for one of the changes do the following:
git checkout change-NUM
<edit>
git add .
git commit --amend
git push origin HEAD:refs/for/dev
When a change was merged remove its local branch:
git branch -D change-NUM