Another way I can think of is the comitter tells the author of B to
rebase its change on A to get B' then send B' to Gerrit again to
replace B. Same thing has to be done for change C, D, E, etc. This
seems impossible. How could a commiter reach an author everytime he/
she want's to commit a change?
How does the real world work?
Yes, and no. The kernel developers are experienced Git users and
sometimes bypass the code review feature and push directly into the
branch. They tend to do that by downloading changes from other
authors, rebasing them into a nice history, testing that code, and
then pushing it directly into the branch.
There are several open feature requests from the kernel developers to
help them smooth this workflow out. Not all of them have made it into
JIRA yet, but have been on the table for months, perhaps since before
AOSP even was announced to the public.
> What extra efforts does the maintainer of the history have to do to
> make the history a straight line with only few branches/merges?
Yea, you need to do the rebase for the developer to submitting it.
The kernel folks often rebase before they upload, and then submit
immediately after uploading, so that they get a nice history.
There is an open feature request to permit Gerrit to do some trivial
rebases in the server automatically, rather than creating a merge.
Its pretty much the same idea, but the trivial rebase discards the
parent information. Its a trade-off for the project owner to make;
keep more accurate development history, or keep a nice straight line
in their history.
Yes, there is a hidden flag. Set a config option in the repository:
git --git-dir=project.git config gerrit.fastforwardonly true
and restart Gerrit.
I was planning on moving this into the database and making it a
checkbox in the web UI this week. Its an old hack from Gerrit 1.x
that got carried into Gerrit 2.x (MergeOp.java is about the only code
that survived intact during the rewrite). This should be a UI level
feature for the project owner, not some hidden thing in the project's
GIT_DIR/config.
After its in the web UI I'll mention it in the release notes, and
probably have a Java tool to help you convert the config file setting
into the database since I need that for r.s.a.c anyway.
It seems currently each "Change Submit Action" will result in one
single last commit in the history.
Gerrit doesn't allow multiple path (e.g. multiple straight line in
kernel/common.git) like normal git repository does, right?