mirror of
https://github.com/php/web-doc.git
synced 2025-08-13 14:40:31 +00:00
Show actual hash on diff output
. Thanks. Closes GH-38
This commit is contained in:

committed by
Nilgün Belma Bugüner

parent
088e06dd7e
commit
27bc12bed0
@ -253,6 +253,7 @@ function showdiff ()
|
|||||||
$arg_h = escapeshellarg($h);
|
$arg_h = escapeshellarg($h);
|
||||||
$arg_f = escapeshellarg($gitfile);
|
$arg_f = escapeshellarg($gitfile);
|
||||||
$file = `git diff {$arg_h} -- {$arg_f}`;
|
$file = `git diff {$arg_h} -- {$arg_f}`;
|
||||||
|
$hash = `git log -n 1 --pretty=format:%H -- {$arg_f}`;
|
||||||
chdir( $cwd );
|
chdir( $cwd );
|
||||||
if (!$file) return;
|
if (!$file) return;
|
||||||
$raw = htmlspecialchars( $file, ENT_XML1, 'UTF-8' );
|
$raw = htmlspecialchars( $file, ENT_XML1, 'UTF-8' );
|
||||||
@ -280,7 +281,7 @@ function showdiff ()
|
|||||||
$tagAccentBg = 'background-color: #d4d8e7;';
|
$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
|
// Count how many lines to skip diff header
|
||||||
$diffStartLine = substr_count($raw, "\n", 0, strpos($raw, " @@"));
|
$diffStartLine = substr_count($raw, "\n", 0, strpos($raw, " @@"));
|
||||||
|
Reference in New Issue
Block a user