Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/treetrek.git

Shows tag date

AuthorDave Jarvis <email>
Date2026-02-10 18:05:12 GMT-0800
Commit07d62cf4c2eebb1bb25c8c27e477930bc90f8c79
Parent23f456b
TagsPage.php
$this->git->eachTag(function($name, $sha) use ($repoParam, &$hasTags) {
$hasTags = true;
- $url = '?hash=' . $sha . $repoParam;
+
+ $filesUrl = '?hash=' . $sha . $repoParam;
+ $commitUrl = '?action=commit&hash=' . $sha . $repoParam;
+
+ // Parse date from object (Tag or Commit)
+ $data = $this->git->read($sha);
+ $date = '';
+
+ // Check for 'tagger' (Annotated Tag)
+ if (preg_match('/^tagger .* (\d+) [+\-]\d{4}$/m', $data, $matches)) {
+ $date = date('Y-m-d', $matches[1]);
+ }
+ // Fallback to 'author' (Lightweight Tag / Commit)
+ elseif (preg_match('/^author .* (\d+) [+\-]\d{4}$/m', $data, $matches)) {
+ $date = date('Y-m-d', $matches[1]);
+ }
echo '<div class="ref-item">';
echo '<span class="ref-type tag">Tag</span>';
- echo '<a href="' . $url . '" class="ref-name">' . htmlspecialchars($name) . '</a>';
- echo '<span class="commit-hash" style="margin-left: auto;">' . substr($sha, 0, 7) . '</span>';
+ echo '<a href="' . $filesUrl . '" class="ref-name">' . htmlspecialchars($name) . '</a>';
+
+ if ($date) {
+ echo '<span class="commit-date" style="margin-left: auto;">' . $date . '</span>';
+ echo '<a href="' . $commitUrl . '" class="commit-hash">' . substr($sha, 0, 7) . '</a>';
+ } else {
+ echo '<a href="' . $commitUrl . '" class="commit-hash" style="margin-left: auto;">' . substr($sha, 0, 7) . '</a>';
+ }
+
echo '</div>';
});
if (!$hasTags) {
echo '<div class="empty-state"><p>No tags found.</p></div>';
}
- echo '</div>'; // end refs-list
+ echo '</div>';
}, $this->currentRepo);
}
Delta26 lines added, 4 lines removed, 22-line increase