Differential D10392 Diff 25011 src/applications/differential/parser/DifferentialCommitMessageParser.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/parser/DifferentialCommitMessageParser.php
| Show First 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | public function parseCorpus($corpus) { | ||||
| // This is another piece of special-cased magic which allows you to | // This is another piece of special-cased magic which allows you to | ||||
| // enter a ridiculously long title, or just type a big block of stream | // enter a ridiculously long title, or just type a big block of stream | ||||
| // of consciousness text, and have some sort of reasonable result conjured | // of consciousness text, and have some sort of reasonable result conjured | ||||
| // from it. | // from it. | ||||
| if (isset($fields[$key_title])) { | if (isset($fields[$key_title])) { | ||||
| $terminal = '...'; | $terminal = '...'; | ||||
| $title = $fields[$key_title]; | $title = $fields[$key_title]; | ||||
| $short = phutil_utf8_shorten($title, 250, $terminal); | $short = id(new PhutilUTF8StringTruncator()) | ||||
| ->setMaximumGlyphs(250) | |||||
| ->setTerminator($terminal) | |||||
| ->truncateString($title); | |||||
| if ($short != $title) { | if ($short != $title) { | ||||
| // If we shortened the title, split the rest into the summary, so | // If we shortened the title, split the rest into the summary, so | ||||
| // we end up with a title like: | // we end up with a title like: | ||||
| // | // | ||||
| // Title title tile title title... | // Title title tile title title... | ||||
| // | // | ||||
| // ...and a summary like: | // ...and a summary like: | ||||
| ▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines | |||||