gerrit/Documentation
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
..
images Remove documentation of "Edit Message" feature 2015-01-30 05:32:46 +00:00
.gitignore Ignore /Documentation/*.html 2015-05-06 11:25:51 -07:00
access-control.txt Add a Maintain Server global capability 2015-06-12 11:15:57 -04:00
asciidoc.defs Pack prettify.min.{js,css} into documentation. 2015-06-26 03:04:09 +00:00
BUCK Vulcanize PolyGerrit in Buck build 2015-11-18 15:26:39 -05:00
cmd-apropos.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
cmd-ban-commit.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
cmd-cherry-pick.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
cmd-close-connection.txt Add command to close SSH connection 2015-01-19 09:54:55 -05:00
cmd-create-account.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
cmd-create-branch.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
cmd-create-group.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
cmd-create-project.txt Remove deprecated --name option from create project SSH command 2015-07-21 15:42:04 +02:00
cmd-flush-caches.txt Add a Maintain Server global capability 2015-06-12 11:15:57 -04:00
cmd-gc.txt Add "aggressive" option to ssh command "GC" 2015-03-19 15:45:29 +01:00
cmd-gsql.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
cmd-hook-commit-msg.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
cmd-index-activate.txt Add ssh command to activate the latest index 2015-07-09 08:05:11 -04:00
cmd-index-start.txt Add ssh command to restart online indexer 2015-07-09 08:05:11 -04:00
cmd-index.txt Merge branch 'stable-2.11' 2015-07-14 11:33:11 +09:00
cmd-kill.txt Revert "== GERRIT" in documentation. 2014-03-25 19:44:49 +00:00
cmd-logging-ls-level.txt Add SSH to configure logging level at runtime 2014-09-26 09:13:35 -04:00
cmd-logging-set-level.txt Add SSH to configure logging level at runtime 2014-09-26 09:13:35 -04:00
cmd-ls-groups.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
cmd-ls-members.txt Documentation: Format fix headlines 2014-03-24 18:32:42 -07:00
cmd-ls-projects.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
cmd-ls-user-refs.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
cmd-plugin-enable.txt Documentation update for cmd-plugin 2015-01-21 11:03:08 +09:00
cmd-plugin-install.txt Documentation update for cmd-plugin 2015-01-21 11:03:08 +09:00
cmd-plugin-ls.txt Correct documentation of required capabilities for listing plugins 2015-04-30 00:58:28 +00:00
cmd-plugin-reload.txt Documentation update for cmd-plugin 2015-01-21 11:03:08 +09:00
cmd-plugin-remove.txt Documentation update for cmd-plugin 2015-01-21 11:03:08 +09:00
cmd-query.txt Terminate sortkey with prejudice 2014-12-23 14:48:06 -08:00
cmd-receive-pack.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
cmd-rename-group.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
cmd-review.txt Add the --strict-labels option to SSH review command 2015-12-17 13:59:56 +09:00
cmd-set-account.txt Fix minor typo in set-account command documentation 2015-05-12 05:03:16 +00:00
cmd-set-head.txt Update set-head ssh command documentation 2015-03-05 09:50:10 +01:00
cmd-set-members.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
cmd-set-project-parent.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
cmd-set-project.txt Fix inconsistency in documentation 2014-05-07 14:51:17 +02:00
cmd-set-reviewers.txt SetReviewersCommand: Use ChangeUtil#findChanges 2015-11-20 14:11:10 -05:00
cmd-show-caches.txt Add a Maintain Server global capability 2015-06-12 11:15:57 -04:00
cmd-show-connections.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
cmd-show-queue.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
cmd-stream-events.txt Add the ability to run a new project created hook 2015-04-21 14:53:53 +09:00
cmd-suexec.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
cmd-test-submit-rule.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
cmd-test-submit-type.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
cmd-version.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
config-auto-site-initialization.txt Control which plugins will be auto installed on auto init 2014-02-24 11:11:04 +01:00
config-cla.txt Remove contact store functionality 2015-08-28 14:08:58 -04:00
config-gerrit.txt Merge branch 'stable-2.12' 2015-12-16 09:41:32 +01:00
config-gitweb.txt Document gitweb URL set, cgi unset configuration 2015-06-22 11:09:31 -07:00
config-hooks.txt Merge branch 'stable-2.11' 2015-04-27 18:25:04 +09:00
config-labels.txt Provide a way to lock patch sets 2015-11-09 12:51:13 -08:00
config-login-register.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
config-mail.txt Add notification when adding keys 2015-09-08 13:37:55 +09:00
config-plugins.txt Add metrics reporter plugins to the list of plugins 2015-11-11 19:50:03 +00:00
config-project-config.txt Add project config boolean to require signed push on a project 2015-10-21 09:09:20 -04:00
config-reverseproxy.txt Update reverse proxy configuration example for nginx 2015-07-06 01:50:38 +00:00
config-sso.txt OpenID: Remove support for Google Accounts 2015-03-01 22:25:50 +01:00
config-themes.txt Remove deprecated gerrit_addHistoryHook(f) JavaScript function 2015-07-21 16:02:44 +02:00
config-validation.txt Added OutgoingEmailValidationListener 2015-01-06 09:02:39 +01:00
config.defs Pack prettify.min.{js,css} into documentation. 2015-06-26 03:04:09 +00:00
database-setup.txt database-setup: Fix typo in Derby section anchor name 2015-10-22 13:59:15 +09:00
dev-buck.txt Merge branch 'stable-2.12' 2015-12-02 18:04:09 +01:00
dev-build-plugins.txt Add HOWTO documentation about building of plugins 2014-01-24 23:16:25 +01:00
dev-contributing.txt Document 'Feature' footer in contribution guide 2015-06-02 12:52:48 +02:00
dev-design.txt Update out of date hyperlinks 2015-06-17 22:38:13 +00:00
dev-eclipse.txt Dev doc: Document the maxCompiledUnitsAtOnce setting in Eclipse 2015-08-28 10:31:47 +09:00
dev-inspector.txt Fix various spelling mistakes 2015-05-19 15:05:26 +09:00
dev-plugins.txt Merge branch 'stable-2.12' 2015-11-24 16:46:43 -05:00
dev-readme.txt Update buck to the latest version 2015-10-09 08:51:35 +02:00
dev-release-deploy-config.txt dev-release-deploy-config: Update Maven config for Google Storage 2015-04-17 14:06:49 +09:00
dev-release-subproject.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
dev-release.txt Update release documentation to update links in new homepage 2015-07-14 11:46:20 +09:00
dev-rest-api.txt Make Content-Type examples consistent with actual server output 2015-01-06 06:54:12 +00:00
doc.css.in Tweak doc css to avoid overlapping with search box 2015-09-16 23:29:20 -07:00
error-branch-not-found.txt Doc: Consistently refer to "Web UI" rather than "WebUI" 2014-05-02 17:21:22 +09:00
error-change-closed.txt Doc: Consistently refer to "Web UI" rather than "WebUI" 2014-05-02 17:21:22 +09:00
error-change-does-not-belong-to-project.txt Consistently refer to Change-Id in documentation 2014-09-04 13:12:24 +09:00
error-change-not-found.txt Consistently refer to Change-Id in documentation 2014-09-04 13:12:24 +09:00
error-change-upload-blocked.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
error-commit-already-exists.txt Merge branch 'stable-2.8' 2014-03-11 18:24:13 +09:00
error-contains-banned-commit.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
error-has-duplicates.txt Consistently refer to Change-Id in documentation 2014-09-04 13:12:24 +09:00
error-invalid-author.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
error-invalid-changeid-line.txt Doc: Consistently refer to "Web UI" rather than "WebUI" 2014-05-02 17:21:22 +09:00
error-invalid-committer.txt Fix reference to Forge Committer access right in documentation 2014-07-08 07:24:01 +00:00
error-messages.txt Improve reject message if Change-Id is in subject 2014-02-21 09:25:33 +01:00
error-missing-changeid.txt Consistently refer to Change-Id in documentation 2014-09-04 13:12:24 +09:00
error-missing-subject.txt Improve reject message if Change-Id is in subject 2014-02-21 09:25:33 +01:00
error-multiple-changeid-lines.txt Doc: Consistently refer to "Web UI" rather than "WebUI" 2014-05-02 17:21:22 +09:00
error-no-changes-made.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
error-no-common-ancestry.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
error-no-new-changes.txt Update no-new-change error message documentation 2015-10-09 14:58:49 +00:00
error-non-fast-forward.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
error-not-a-gerrit-administrator.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
error-not-allowed-to-upload-merges.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
error-not-permitted-to-create.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
error-not-signed-off-by.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
error-not-valid-ref.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
error-permission-denied.txt Doc: Consistently refer to "Web UI" rather than "WebUI" 2014-05-02 17:21:22 +09:00
error-prohibited-by-gerrit.txt Work around asciidoctor handling of nested ` and * 2015-04-06 17:22:37 +09:00
error-project-not-found.txt Doc: Consistently refer to "Web UI" rather than "WebUI" 2014-05-02 17:21:22 +09:00
error-push-fails-due-to-commit-message.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
error-squash-commits-first.txt Minor improvements in the 'squash commits first' error documentation 2014-09-05 09:25:33 +09:00
error-upload-denied.txt Added searchbox to documentation. 2013-11-05 12:49:43 -08:00
gen_licenses.py gen_licenses.py: Strip __download suffix from JS libs 2015-12-01 14:15:13 +00:00
i18n-readme.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
index.txt Remove contact store functionality 2015-08-28 14:08:58 -04:00
install-j2ee.txt Fix broken formatting in Tomcat reverse proxy config documentation 2014-10-21 11:04:42 +09:00
install-quick.txt Correct docs since --name is not a valid option for create-project 2015-11-25 00:27:32 +00:00
install.txt Offer downloads through https://www.gerritcodereview.com/download/ 2015-06-12 19:07:37 -07:00
intro-project-owner.txt Use consistent lowercase for "gitweb" 2015-06-12 13:24:46 -04:00
intro-quick.txt Consistently refer to Change-Id in documentation 2014-09-04 13:12:24 +09:00
intro-user.txt Move 'User Refs' docs to the intro-user doc. 2015-09-04 14:55:15 +00:00
js-api.txt Make ServerInfo accessible by plugins 2015-08-05 09:39:24 +02:00
json.txt Remove the state SUBMITTED altogether 2015-07-10 13:51:01 -07:00
license.defs gen_licenses.py: Use buck query for license generation 2015-11-12 18:40:30 -05:00
pgm-daemon.txt Allow to use --enable-httpd with --slave 2014-10-30 11:02:24 -04:00
pgm-gsql.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
pgm-index.txt Add documentation for SecureStore 2015-02-23 09:53:05 +01:00
pgm-init.txt Add documentation of the --dev option on the init command 2015-11-08 12:12:28 -08:00
pgm-LocalUsernamesToLowerCase.txt Doc: Consistently refer to "Web UI" rather than "WebUI" 2014-05-02 17:21:22 +09:00
pgm-prolog-shell.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
pgm-reindex.txt Remove --recheck-mergeable option from reindex documentation 2015-09-24 10:10:40 +02:00
pgm-rulec.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
pgm-SwitchSecureStore.txt Add documentation for SecureStore 2015-02-23 09:53:05 +01:00
project-configuration.txt Merge branch 'stable-2.11' 2015-05-04 16:44:45 +02:00
prolog-change-facts.txt Use the new section title style in Asciidoctor. 2013-12-20 12:55:51 -08:00
prolog-cookbook.txt MergeOp: Disallow multiple submit types on a single branch 2015-12-17 13:25:02 -05:00
replace_macros.py tools: use python on path 2015-06-18 17:10:11 +02:00
rest-api-access.txt Make Content-Type examples consistent with actual server output 2015-01-06 06:54:12 +00:00
rest-api-accounts.txt Add a dropdown to control email notifications on user preference page 2015-12-07 16:13:41 -05:00
rest-api-changes.txt Merge "Allow to remove specific scores while leaving the reviewer listed" 2015-11-25 10:39:15 +00:00
rest-api-config.txt Merge doc and change searches. 2015-11-24 22:14:39 -08:00
rest-api-documentation.txt Don't limit tables to 50% width in REST API documentation 2014-11-25 18:35:53 +09:00
rest-api-groups.txt Adds group suggestions into ListGroups REST API. 2015-09-17 10:35:31 -07:00
rest-api-plugins.txt Make Content-Type examples consistent with actual server output 2015-01-06 06:54:12 +00:00
rest-api-projects.txt Merge branch 'stable-2.11' into stable-2.12 2015-12-08 10:27:44 +09:00
rest-api.txt Consistently format HTTP response codes in REST API documentation 2015-01-21 11:42:32 +09:00
user-change-cleanup.txt Add background job to abandon inactive changes automatically 2015-06-25 07:26:25 +02:00
user-changeid.txt Work around asciidoctor handling of nested ` and * 2015-04-06 17:22:37 +09:00
user-dashboards.txt Add user guide 2015-04-30 14:37:09 +00:00
user-inline-edit.txt Merge branch 'stable-2.11' 2015-10-27 11:10:42 +09:00
user-named-destinations.txt Add named destinations support 2015-09-03 10:50:07 -06:00
user-named-queries.txt Move 'User Refs' docs to the intro-user doc. 2015-09-04 14:55:15 +00:00
user-notify.txt Clarify notification scheme on watched projects 2014-12-12 13:46:38 -06:00
user-review-ui.txt Remove "Submitted, Merge Pending" from review UI documentation 2015-09-07 13:54:07 +09:00
user-search.txt Support indexing changes by author and committer 2015-09-07 17:29:35 +09:00
user-signedoffby.txt Revert "== GERRIT" in documentation. 2014-03-25 19:44:49 +00:00
user-submodules.txt SubmoduleOp: Have a flag for verbosity of superproject messages 2015-07-20 09:19:23 -07:00
user-upload.txt Add user guide 2015-04-30 14:37:09 +00:00