Add option to match author timestamp and committed timestamp
When true, the author date is changed to match the submitter date upon submission of a change. This is done so that git log will show the submission date instead of the author date, which it does by default. This option only takes effect in submit strategies which already modify the commit, i.e. Cherry Pick, Rebase Always, and (perhaps) Rebase If Necessary. Bug: https://crbug.com/732968 Change-Id: I64133a3e494e8c6364cd210f68979aaff74cb222
This commit is contained in:
@@ -77,6 +77,8 @@ public interface AdminConstants extends Constants {
|
||||
|
||||
String enableReviewerByEmail();
|
||||
|
||||
String matchAuthorToCommitterDate();
|
||||
|
||||
String headingMaxObjectSizeLimit();
|
||||
|
||||
String headingGroupOptions();
|
||||
|
||||
@@ -38,6 +38,7 @@ headingParentProjectName = Rights Inherit From
|
||||
parentSuggestions = Parent Suggestion
|
||||
columnProjectName = Project Name
|
||||
enableReviewerByEmail = Enable adding unregistered users as reviewers and CCs on changes
|
||||
matchAuthorToCommitterDate = Match authored date with committer date upon submit
|
||||
|
||||
headingGroupUUID = Group UUID
|
||||
headingOwner = Owners
|
||||
|
||||
@@ -87,6 +87,7 @@ public class ProjectInfoScreen extends ProjectScreen {
|
||||
private ListBox requireSignedPush;
|
||||
private ListBox rejectImplicitMerges;
|
||||
private ListBox enableReviewerByEmail;
|
||||
private ListBox matchAuthorToCommitterDate;
|
||||
private NpTextBox maxObjectSizeLimit;
|
||||
private Label effectiveMaxObjectSizeLimit;
|
||||
private Map<String, Map<String, HasEnabled>> pluginConfigWidgets;
|
||||
@@ -193,6 +194,7 @@ public class ProjectInfoScreen extends ProjectScreen {
|
||||
rejectImplicitMerges.setEnabled(isOwner);
|
||||
maxObjectSizeLimit.setEnabled(isOwner);
|
||||
enableReviewerByEmail.setEnabled(isOwner);
|
||||
matchAuthorToCommitterDate.setEnabled(isOwner);
|
||||
|
||||
if (pluginConfigWidgets != null) {
|
||||
for (Map<String, HasEnabled> widgetMap : pluginConfigWidgets.values()) {
|
||||
@@ -270,6 +272,10 @@ public class ProjectInfoScreen extends ProjectScreen {
|
||||
saveEnabler.listenTo(enableReviewerByEmail);
|
||||
grid.addHtml(AdminConstants.I.enableReviewerByEmail(), enableReviewerByEmail);
|
||||
|
||||
matchAuthorToCommitterDate = newInheritedBooleanBox();
|
||||
saveEnabler.listenTo(matchAuthorToCommitterDate);
|
||||
grid.addHtml(AdminConstants.I.matchAuthorToCommitterDate(), matchAuthorToCommitterDate);
|
||||
|
||||
maxObjectSizeLimit = new NpTextBox();
|
||||
saveEnabler.listenTo(maxObjectSizeLimit);
|
||||
effectiveMaxObjectSizeLimit = new Label();
|
||||
@@ -402,6 +408,7 @@ public class ProjectInfoScreen extends ProjectScreen {
|
||||
}
|
||||
setBool(rejectImplicitMerges, result.rejectImplicitMerges());
|
||||
setBool(enableReviewerByEmail, result.enableReviewerByEmail());
|
||||
setBool(matchAuthorToCommitterDate, result.matchAuthorToCommitterDate());
|
||||
setSubmitType(result.submitType());
|
||||
setState(result.state());
|
||||
maxObjectSizeLimit.setText(result.maxObjectSizeLimit().configuredValue());
|
||||
@@ -673,6 +680,7 @@ public class ProjectInfoScreen extends ProjectScreen {
|
||||
rsp,
|
||||
getBool(rejectImplicitMerges),
|
||||
getBool(enableReviewerByEmail),
|
||||
getBool(matchAuthorToCommitterDate),
|
||||
maxObjectSizeLimit.getText().trim(),
|
||||
SubmitType.valueOf(submitType.getValue(submitType.getSelectedIndex())),
|
||||
ProjectState.valueOf(state.getValue(state.getSelectedIndex())),
|
||||
|
||||
@@ -60,6 +60,9 @@ public class ConfigInfo extends JavaScriptObject {
|
||||
public final native InheritedBooleanInfo enableReviewerByEmail()
|
||||
/*-{ return this.enable_reviewer_by_email; }-*/ ;
|
||||
|
||||
public final native InheritedBooleanInfo matchAuthorToCommitterDate()
|
||||
/*-{ return this.match_author_to_committer_date; }-*/ ;
|
||||
|
||||
public final SubmitType submitType() {
|
||||
return SubmitType.valueOf(submitTypeRaw());
|
||||
}
|
||||
|
||||
@@ -148,6 +148,7 @@ public class ProjectApi {
|
||||
InheritableBoolean requireSignedPush,
|
||||
InheritableBoolean rejectImplicitMerges,
|
||||
InheritableBoolean enableReviewerByEmail,
|
||||
InheritableBoolean matchAuthorToCommitterDate,
|
||||
String maxObjectSizeLimit,
|
||||
SubmitType submitType,
|
||||
ProjectState state,
|
||||
@@ -172,6 +173,7 @@ public class ProjectApi {
|
||||
in.setState(state);
|
||||
in.setPluginConfigValues(pluginConfigValues);
|
||||
in.setEnableReviewerByEmail(enableReviewerByEmail);
|
||||
in.setMatchAuthorToCommitterDate(matchAuthorToCommitterDate);
|
||||
|
||||
project(name).view("config").put(in, cb);
|
||||
}
|
||||
@@ -300,6 +302,13 @@ public class ProjectApi {
|
||||
setEnableReviewerByEmailRaw(v.name());
|
||||
}
|
||||
|
||||
final void setMatchAuthorToCommitterDate(InheritableBoolean v) {
|
||||
setMatchAuthorToCommitterDateRaw(v.name());
|
||||
}
|
||||
|
||||
private native void setMatchAuthorToCommitterDateRaw(String v)
|
||||
/*-{ if(v)this.match_author_to_committer_date=v; }-*/ ;
|
||||
|
||||
private native void setEnableReviewerByEmailRaw(String v)
|
||||
/*-{ if(v)this.enable_reviewer_by_email=v; }-*/ ;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user