Reputation: 3397
We are deciding to use Gerrit or GitLab for code review.
And here is our commit history guide:
rebase
and merge --no-ff
for every branch to clarify the branch commit history (tasks)The git graph is like this:
We can read the tasks easily.
There is a rebase
button and merge always (merge --no-ff
) in the project settings, but I don't know how to make the rebase
and merge --no-ff
always be ATOMIC operation by Gerrit.
It means that, when I submit to merge into the main branch, no one can submit another merge before my two step git operations are done (rebase
and merge --no-ff
).
If it is not atomic, then after I rebase my branch to the latest commit of the main branch (HEAD
) and just before I merge into main branch, someone could submit a merge and it will change the HEAD
.
The git graph will be just like this (two non-fast-forward merges from the same commit):
Is there any way to force to atomically rebase and non-fast-forward merge using Gerrit?
There is a GitLab enterprise edition to support rebase
and merge --no-ff
, but we choose use community edition.
Is that possible to add the functionality (atomic rebase
and merge --no-ff
) to GitLab on our own? Any open-source GitLab plugin for this feature?
Upvotes: 1
Views: 654
Reputation: 22491
No, there isn't a way to force atomically rebase+submit (in whatever submit method). What about to use the "Rebase If Necessary" method? You'll get a very "clean" history without unnecessary merges, like this:
O --- O --- O --- O --- O --- O <= master branch
\ /
O ---- O ---- O <= task branch
Upvotes: 0