[DOC-WEB] [web-doc] master: Show actual hash on diff output

1 view
Skip to first unread message

alfsb via Nilgün Belma Bugüner

unread,
Oct 15, 2022, 3:49:03 AM10/15/22
to doc...@lists.php.net
Author: alfsb (alfsb)
Committer: Nilgün Belma Bugüner (nilgun)
Date: 2022-10-15T10:48:37+03:00

Commit: https://github.com/php/web-doc/commit/27bc12bed0e56c45ca7eeb49dfc59b0d0be6c16e
Raw diff: https://github.com/php/web-doc/commit/27bc12bed0e56c45ca7eeb49dfc59b0d0be6c16e.diff

Show actual hash on diff output
. Thanks. Closes GH-38

Changed paths:
M include/lib_revcheck.inc.php


Diff:

diff --git a/include/lib_revcheck.inc.php b/include/lib_revcheck.inc.php
index 0ff14fc..745df8f 100644
--- a/include/lib_revcheck.inc.php
+++ b/include/lib_revcheck.inc.php
@@ -253,6 +253,7 @@ function showdiff ()
$arg_h = escapeshellarg($h);
$arg_f = escapeshellarg($gitfile);
$file = `git diff {$arg_h} -- {$arg_f}`;
+ $hash = `git log -n 1 --pretty=format:%H -- {$arg_f}`;
chdir( $cwd );
if (!$file) return;
$raw = htmlspecialchars( $file, ENT_XML1, 'UTF-8' );
@@ -280,7 +281,7 @@ function showdiff ()
$tagAccentBg = 'background-color: #d4d8e7;';
}

- echo "<div style='padding: 12px;'>$gitfile</div>";
+ echo "<div style='padding: 12px;'>$gitfile<br/>$hash</div>";

// Count how many lines to skip diff header
$diffStartLine = substr_count($raw, "\n", 0, strpos($raw, " @@"));

--
Documentation Website Mailing List (http://doc.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply all
Reply to author
Forward
0 new messages