Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F77321
D7443.diff
All Users
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7443.diff
View Options
diff --git a/src/applications/differential/conduit/ConduitAPI_differential_parsecommitmessage_Method.php b/src/applications/differential/conduit/ConduitAPI_differential_parsecommitmessage_Method.php
--- a/src/applications/differential/conduit/ConduitAPI_differential_parsecommitmessage_Method.php
+++ b/src/applications/differential/conduit/ConduitAPI_differential_parsecommitmessage_Method.php
@@ -169,6 +169,38 @@
$fields[$name] = $data;
}
+ // 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
+ // of consciousness text, and have some sort of reasonable result conjured
+ // from it.
+ if (isset($fields['title'])) {
+ $terminal = '...';
+ $title = $fields['title'];
+ $short = phutil_utf8_shorten($title, 250, $terminal);
+ if ($short != $title) {
+
+ // If we shortened the title, split the rest into the summary, so
+ // we end up with a title like:
+ //
+ // Title title tile title title...
+ //
+ // ...and a summary like:
+ //
+ // ...title title title.
+ //
+ // Summary summary summary summary.
+
+ $summary = idx($fields, 'summary', '');
+ $offset = strlen($short) - strlen($terminal);
+ $remainder = ltrim(substr($fields['title'], $offset));
+ $summary = '...'.$remainder."\n\n".$summary;
+ $summary = rtrim($summary, "\n");
+
+ $fields['title'] = $short;
+ $fields['summary'] = $summary;
+ }
+ }
+
return $fields;
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/iq/64/ebpd575743cf6lhh
Default Alt Text
D7443.diff (1 KB)
Attached To
Mode
D7443: Split exceptionally huge revision titles into the summary
Attached
Detach File
Event Timeline
Log In to Comment