diff --git a/src/applications/differential/conduit/ConduitAPI_differential_getcommitmessage_Method.php b/src/applications/differential/conduit/ConduitAPI_differential_getcommitmessage_Method.php index a7b48b025f..9c4e7d7530 100644 --- a/src/applications/differential/conduit/ConduitAPI_differential_getcommitmessage_Method.php +++ b/src/applications/differential/conduit/ConduitAPI_differential_getcommitmessage_Method.php @@ -102,7 +102,8 @@ final class ConduitAPI_differential_getcommitmessage_Method $label = $field->renderLabelForCommitMessage(); if (!strlen($value)) { if ($field_key === 'title') { - $commit_message[] = '<>'; + $commit_message[] = + DifferentialTitleFieldSpecification::getDefaultRevisionTitle(); } else { if ($field->shouldAppearOnCommitMessageTemplate() && $is_edit) { $commit_message[] = $label.': '; diff --git a/src/applications/differential/field/specification/DifferentialTitleFieldSpecification.php b/src/applications/differential/field/specification/DifferentialTitleFieldSpecification.php index 07095e0800..59fb375e32 100644 --- a/src/applications/differential/field/specification/DifferentialTitleFieldSpecification.php +++ b/src/applications/differential/field/specification/DifferentialTitleFieldSpecification.php @@ -41,7 +41,16 @@ final class DifferentialTitleFieldSpecification if (!strlen($this->title)) { $this->error = 'Required'; throw new DifferentialFieldValidationException( - "You must provide a title."); + "You must provide a revision title in the first line ". + "of your commit message."); + } + + if (preg_match('/^<<.*>>$/', $this->title)) { + $default_title = self::getDefaultRevisionTitle(); + $this->error = 'Required'; + throw new DifferentialFieldValidationException( + "Replace the line '{$default_title}' with a revision title ". + "that describes the change."); } } @@ -86,6 +95,10 @@ final class DifferentialTitleFieldSpecification return 'wide pri'; } + public static function getDefaultRevisionTitle() { + return '<>'; + } + public function renderValueForRevisionList(DifferentialRevision $revision) { return phutil_tag( 'a',