diff --git a/lib/Ebook.php b/lib/Ebook.php index 1a7d0859..c34d43e1 100644 --- a/lib/Ebook.php +++ b/lib/Ebook.php @@ -124,11 +124,11 @@ class Ebook{ } // Fill in the short history of this repo. - $historyEntries = explode("\n", shell_exec('cd ' . escapeshellarg($this->RepoFilesystemPath) . ' && git log -n5 --pretty=format:"%ct %s"') ?? ''); + $historyEntries = explode("\n", shell_exec('cd ' . escapeshellarg($this->RepoFilesystemPath) . ' && git log -n5 --pretty=format:"%ct %H %s"') ?? ''); foreach($historyEntries as $entry){ - $array = explode(' ', $entry, 2); - $this->GitCommits[] = new GitCommit($array[0], $array[1]); + $array = explode(' ', $entry, 3); + $this->GitCommits[] = new GitCommit($array[0], $array[1], $array[2]); } // Get cover image URLs. diff --git a/lib/GitCommit.php b/lib/GitCommit.php index 921abc92..466d9b23 100644 --- a/lib/GitCommit.php +++ b/lib/GitCommit.php @@ -4,9 +4,11 @@ use Safe\DateTimeImmutable; class GitCommit{ public $Timestamp; public $Message; + public $Hash; - public function __construct(string $unixTimestamp, string $message){ + public function __construct(string $unixTimestamp, string $hash, string $message){ $this->Timestamp = new DateTimeImmutable('@' . $unixTimestamp); $this->Message = $message; + $this->Hash = $hash; } } diff --git a/www/ebooks/ebook.php b/www/ebooks/ebook.php index 3575ea1a..463440ff 100644 --- a/www/ebooks/ebook.php +++ b/www/ebooks/ebook.php @@ -136,7 +136,7 @@ catch(\Exception $ex){ foreach($ebook->GitCommits as $commit){ ?>
= Formatter::ToPlainText($commit->Message) ?>
+