This might be easier to review if split into two parts. Code suffling to
do --ff/--no-ff => ff={allow,never} and documentation updates to improve
the description of these two options in the first patch, and addition of
"only" to code and the updated docuemntation in the second.
If you remove one sentence "The last merge ... =only'." from it, this part
is a very good write-up on how "never fast forward" could be useful, and
might even be a worthy addition to the current documentation. However it
lacks a crucial bit of information: it is _not enough_ to just use --no-ff
to maintain the "special status" of "master". You also need to prevent
direct committing to it. So while --no-ff is an ingredient you can
construct such a workflow out of, it by itself is not the whole solution.
You need additional discipline.
This,...
combined with the above, would make "only" an incomplete implementation of
the goal you stated earlier, i.e. "to force a completely linear history",
but I think you can trivially fix this by making sure that there is no
merge commit in ORIG_HEAD..MERGE_HEAD and refusing if you find one. And
by fixing the implementation, you do not have to make excuses like the
above two and half paragraphs.
Having said that, I doubt what you are trying to achieve is to force a
totally linear history, as that is quite useless policy unless you are
talking about a one-man project.
When your project has gained meaningful number of developers, there will
always be more than one nontrivial changes outstanding. Forcing a linear
history everywhere means whenever somebody wants his changes accepted, he
needs to fetch + rebase whenever anybody else's change is accepted to the
special "master". The more developers you have, the narrower window
between acceptance of changes to the "master" becomes, and eventually the
window will become shorter than the time needed to rebase and retest any
nontrivial change on top of the tip of "master". At that point, nobody
can get anything but a trivially rebasable and untested series accepted.
Such a policy would encourage people to merge only "early half" of their
series (because they do not have enough time to rebase the full series) in
a poorly tested shape. So in that sense it is not just "practicaly
useless", but can be actively harmful by encouraging a bad workflow.
But your "merge has to fast-forward, but the merged branch can have
nonlinear history itself" semantics is different from "require linear
history". For example, if you want the top-level integrator to do
absolutely _nothing_ (not even a trivial merge), in order to shift the
burden of integration testing to contributors, then use of such semantics
(which is _different_ from "completely linear") by the top-level
integrator could achieve that. Nobody can ask the top-level to pull which
would result in a tree that he built and tested himself. The top-level
integrator would say "Your tree is not a fast-forward from mine, because I
merged with somebody else between the time you prepared your tree and I
learned about it. Please try again", and in response, the contributor can
pull from the top-level integrator and re-test the merge result and ask
again. With luck, the top-level integrator may not have merged with
anybody else and a pull from that contributor would fast-forward.
So if that is what you are trying to achieve, you need to update your
description. If you aim for "Totally linear", I think many people will
find it is practically useless, but if you are aiming for something
different, you should advertise it as such.
I think the scaling issue (iow "narrowing window") is the same either way,
and the documentaion should warn about it to the users. Unclueful people
may think, without really thinking ;-), that it is a good thing in any
occassions to require totally linear history, unless downsides are also
explained.
I do not think you defended why it is good idea to drop this sanity check.
Strategies? "fast forward options" you used in the option description is
a reasonable one, and it would be better to keep it consistent.
I didn't look at the rest of the patch (yet).
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html