ShortLog: Show only 'real commit' titles in bold
Signed-off-by: Chris Han <xiphux@gmail.com>
--- a/css/gitphpskin.css
+++ b/css/gitphpskin.css
@@ -325,6 +325,14 @@
color: #880000;
}
+span.commit_title {
+ font-weight: bold;
+}
+
+span.merge_title {
+ color: #777777;
+}
+
span.newfile {
color: #008000;
}
--- a/include/git/Commit.class.php
+++ b/include/git/Commit.class.php
@@ -195,6 +195,17 @@
*/
private $treeReferenced = false;
+
+ /**
+ * mergeCommit *tpr*
+ *
+ * Stores whether the commit is a Merge
+ *
+ * @access private
+ */
+ private $mergeCommit = false;
+
+
/**
* __construct
*
@@ -510,6 +521,14 @@
return time() - $this->committerEpoch;
return '';
+ }
+
+ public function isMergeCommit()
+ {
+ if (!$this->dataRead)
+ $this->ReadData();
+
+ return $this->mergeCommit;
}
/**
@@ -581,6 +600,9 @@
if (empty($this->title) && (strlen($trimmed) > 0))
$this->title = $trimmed;
if (!empty($this->title)) {
+ if (substr($this->title,0,6) == "Merge ")
+ $this->mergeCommit = true;
+
if ((strlen($trimmed) > 0) || ($i < (count($lines)-1)))
$this->comment[] = $trimmed;
}
@@ -981,7 +1003,7 @@
if (!$this->treeReferenced)
$this->ReferenceTree();
- $properties = array('dataRead', 'parents', 'tree', 'author', 'authorEpoch', 'authorTimezone', 'committer', 'committerEpoch', 'committerTimezone', 'title', 'comment', 'readTree', 'blobPaths', 'treePaths', 'hashPathsRead', 'parentsReferenced', 'treeReferenced');
+ $properties = array('dataRead', 'parents', 'tree', 'author', 'authorEpoch', 'authorTimezone', 'committer', 'committerEpoch', 'committerTimezone', 'title', 'comment', 'readTree', 'blobPaths', 'treePaths', 'hashPathsRead', 'parentsReferenced', 'treeReferenced', 'mergeCommit');
return array_merge($properties, parent::__sleep());
}
--- a/templates/shortloglist.tpl
+++ b/templates/shortloglist.tpl
@@ -15,7 +15,9 @@
<td title="{if $rev->GetAge() > 60*60*24*7*2}{$rev->GetAge()|agestring}{else}{$rev->GetCommitterEpoch()|date_format:"%Y-%m-%d"}{/if}"><em>{if $rev->GetAge() > 60*60*24*7*2}{$rev->GetCommitterEpoch()|date_format:"%Y-%m-%d"}{else}{$rev->GetAge()|agestring}{/if}</em></td>
<td><em>{$rev->GetAuthorName()}</em></td>
<td>
- <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commit&h={$rev->GetHash()}" class="list commitTip" {if strlen($rev->GetTitle()) > 50}title="{$rev->GetTitle()|htmlspecialchars}"{/if}><strong>{$rev->GetTitle(50)|escape}</strong></a>
+ <a href="{$SCRIPT_NAME}?p={$project->GetProject()|urlencode}&a=commit&h={$rev->GetHash()}" class="list commitTip" {if strlen($rev->GetTitle()) > 50}title="{$rev->GetTitle()|htmlspecialchars}"{/if}>
+ {if $rev->isMergeCommit()}<span class="merge_title">{else}<span class="commit_title">{/if}{$rev->GetTitle(50)|escape}</span>
+ </a>
{include file='refbadges.tpl' commit=$rev}
</td>
<td class="link">