Add rejectEmptyCommit project config

If a change is identified as the root cause of a problem, different
users sometimes create reverts independently and try to submit them. The
first revert merges cleanly and reverts the problematic code. The second
revert rebases cleanly, but results in an empty commit that is then
merged.

Some users don't want empty commits in their project. This commit adds a
project config to prevent empty commits as a result of merging changes
in Gerrit.

The UI will be adapted in a later commit to allow easy modifications of
the new config option.

Change-Id: Ied0c501a6cb8963328440074529834cb43e96439
This commit is contained in:
Patrick Hiesel
2018-01-08 17:20:15 +01:00
parent 93f9809f84
commit dc285c7b46
19 changed files with 149 additions and 2 deletions

View File

@@ -35,6 +35,7 @@ public class ConfigInfo {
public InheritedBooleanInfo privateByDefault;
public InheritedBooleanInfo enableReviewerByEmail;
public InheritedBooleanInfo matchAuthorToCommitterDate;
public InheritedBooleanInfo rejectEmptyCommit;
public MaxObjectSizeLimitInfo maxObjectSizeLimit;
public SubmitType submitType;

View File

@@ -32,6 +32,7 @@ public class ConfigInput {
public InheritableBoolean privateByDefault;
public InheritableBoolean enableReviewerByEmail;
public InheritableBoolean matchAuthorToCommitterDate;
public InheritableBoolean rejectEmptyCommit;
public String maxObjectSizeLimit;
public SubmitType submitType;
public ProjectState state;

View File

@@ -33,6 +33,7 @@ public class ProjectInput {
public InheritableBoolean useContentMerge;
public InheritableBoolean requireChangeId;
public InheritableBoolean createNewChangeForAllNotInTarget;
public InheritableBoolean rejectEmptyCommit;
public String maxObjectSizeLimit;
public Map<String, Map<String, ConfigValue>> pluginConfigValues;
}