gerrit/ReleaseNotes
Dave Borowitz 0761fd5ce4 MergeOp: Disallow multiple submit types on a single branch
Submit type rules allow different changes to the same branch to have
different submit types. A main use case for this functionality is
allowing branch-specific rather than project-specific submit types.

However, in theory this also allows a single batch of commits to mix
submit types. MergeOp currently handles this situation by splitting
up open changes on a branch by submit type and running submit types
on each subset in arbitrary order (based on HashMap iteration).

My thesis is that this behavior produces nondeterministic results
that, even if we can justify them as "sane", are likely to be
surprising and/or confusing to the user, and that we are better off
failing fast rather than trying to support this scenario.

In the past, there was a distinct reason for this behavior, which was
that there might be (through no fault of a user) changes in the
submitted state with various submit types. Spinning through the submit
type list and making progress, while perhaps confusing, was probably
better than not making progress at all. But now that the submitted
state is gone, the only way in which multiple changes can be submitted
at once is within a single batch (including parents or by topic), so
this reasoning does not really exist any more.

For one example of confusing behavior, say we have two changes A<-B
based on the branch tip 0, where A is Merge Always and B is Merge If
Necessary. If MergeOp chooses to run Merge Always first, the resulting
history will be:

 0----Ma--Mab
  \-A-/   /
     \-B-/

If, however, MergeOp chooses to run Merge If Necessary first, the
merge sorter will choose the fast-forward resolution for B, resulting
in:

 0--A--B

When Merge Always runs, it will find that A is already merged and do
nothing.

For another example, consider three changes A<-B<-C, where A and C
are Cherry-Pick and B is Merge If Necessary. If MergeOp chooses to
run Cherry-Pick first, it cherry-picks A' and C':

 0--A'--C'

Then merging B fails since it now depends on an out-of-date patch set
of A.

If MergeOp chooses Merge If Necessary first, then B gets chosen as a
fast-forward and C gets cherry-picked on top:

 0--A--B--C'

It is not at all obvious that any one of these solutions is what the
user expects to get, to say nothing of more complicated cases.

Note that I am only about 75% sure of what actually happens in these
scenarios; I might be completely wrong. That just goes to show how
weird this behavior is.

Enforce during validateChangeList that only a single submit type is
present on each branch. This also eliminates one level of looping in
the main integrateIntoHistory logic.

Another possible solution would be in the case of mixed submit types
to run the entire process one change at a time in topological order.
This at least might be easier to reason about, although it would still
not always succeed, for example if a Merge Always change follows a
Cherry-Pick change. But it would introduce considerably more
complexity to rework the loops in MergeOp, all for the questionable
benefit of making it easier for users to get into a confused
situation. Better to just not let them do it at all.

Change-Id: I0cec2a7e3e3625fedbdd621b0c6eca6c4100f232
2015-12-17 13:25:02 -05:00
..
.gitignore Move release notes into the repository 2010-02-17 09:16:26 -08:00
asciidoc.conf Release Notes: Set max page width to 55em 2014-02-18 18:58:29 +09:00
index.txt Initial skeleton of release notes for 2.13 2015-11-13 07:55:44 -08:00
Makefile Improve the version computation for the release notes 2015-04-16 12:38:17 +00:00
ReleaseNotes-2.0.2.txt Update out of date hyperlinks 2015-06-17 22:38:13 +00:00
ReleaseNotes-2.0.3.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.0.4.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.0.5.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.0.6.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.0.7.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.0.8.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.0.9.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.0.10.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.0.11.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.0.12.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.0.13.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.0.14.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.0.15.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.0.16.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.0.17.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.0.18.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.0.19.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.0.20.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.0.21.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.0.22.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.0.23.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.0.24.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.1.1.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.1.2.1.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.1.2.2.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.1.2.3.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.1.2.4.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.1.2.5.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.1.2.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.1.3.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.1.4.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.1.5.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.1.6.1.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.1.6.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.1.7.2.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.1.7.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.1.8.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.1.9.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.1.10.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.1.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.2.0.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.2.1.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.2.2.1.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.2.2.2.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.2.2.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.3.1.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.3.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.4.1.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.4.2.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.4.3.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.4.4.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.4.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.5.1.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.5.2.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.5.3.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.5.4.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.5.5.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.5.6.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.5.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.6.1.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.6.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.7.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.8.1.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.8.2.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.8.3.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.8.4.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.8.5.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.8.6.1.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.8.6.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.8.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.9.1.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.9.2.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.9.3.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.9.4.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.9.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.10.1.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.10.2.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.10.3.1.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.10.3.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.10.4.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.10.5.txt Release notes for 2.10.5 2015-06-10 16:24:58 +02:00
ReleaseNotes-2.10.6.txt Release notes for Gerrit 2.10.6 2015-06-29 14:10:30 +02:00
ReleaseNotes-2.10.7.txt Fix link in 2.10.7 release notes 2015-10-13 12:15:20 +00:00
ReleaseNotes-2.10.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.11.1.txt Merge "Offer downloads through https://www.gerritcodereview.com/download/" 2015-06-17 22:38:03 +00:00
ReleaseNotes-2.11.2.txt Add missing fix in 2.11.2 release notes 2015-07-14 18:07:25 +09:00
ReleaseNotes-2.11.3.txt Release notes for Gerrit 2.11.3 2015-08-21 10:20:32 +09:00
ReleaseNotes-2.11.4.txt Update 2.11.4 release notes 2015-10-15 13:21:55 +09:00
ReleaseNotes-2.11.5.txt Update 2.11.5 release notes to mention forked buck 2015-12-09 01:32:48 +00:00
ReleaseNotes-2.11.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
ReleaseNotes-2.12.txt Update 2.12 release notes 2015-11-27 11:29:29 +09:00
ReleaseNotes-2.13.txt MergeOp: Disallow multiple submit types on a single branch 2015-12-17 13:25:02 -05:00