1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 08:42:41 +01:00

Decrease commit identifier display length

Summary: We are running out of horizontal space, this should help a bit.

Test Plan: Homepage, revision.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4518
This commit is contained in:
vrana 2013-01-18 14:43:34 -08:00
parent 4f5123e253
commit 9a3d0f71a3

View file

@ -48,9 +48,9 @@ final class DifferentialLocalCommitsView extends AphrontView {
$row = array();
if (idx($commit, 'commit')) {
$commit_hash = substr($commit['commit'], 0, 16);
$commit_hash = self::formatCommit($commit['commit']);
} else if (isset($commit['rev'])) {
$commit_hash = substr($commit['rev'], 0, 16);
$commit_hash = self::formatCommit($commit['rev']);
} else {
$commit_hash = null;
}
@ -58,7 +58,7 @@ final class DifferentialLocalCommitsView extends AphrontView {
if ($has_tree) {
$tree = idx($commit, 'tree');
$tree = substr($tree, 0, 16);
$tree = self::formatCommit($tree);
$row[] = phutil_tag('td', array(), $tree);
}
@ -72,7 +72,7 @@ final class DifferentialLocalCommitsView extends AphrontView {
if (is_array($parent)) {
$parent = idx($parent, 'rev');
}
$parents[$k] = substr($parent, 0, 16);
$parents[$k] = self::formatCommit($parent);
}
$parents = phutil_implode_html(phutil_tag('br'), $parents);
$row[] = phutil_tag('td', array(), $parents);
@ -141,4 +141,9 @@ final class DifferentialLocalCommitsView extends AphrontView {
$headers,
phutil_implode_html("\n", $rows));
}
private static function formatCommit($commit) {
return substr($commit, 0, 12);
}
}