From 8761304449656e99adfce635f854827c7fa0134f Mon Sep 17 00:00:00 2001 From: jebsolutions Date: Sat, 26 Nov 2016 02:21:31 -0500 Subject: [PATCH] show git branch + commit. +link to preview git changes (#2186) * show git branch + commit. +link to preview git changes new feature - bottom of upgrade screen shows git branch + commit you are on - provides a link to github showing changes since then on your current branch More eyes reviewing the code is always a plus. The github link helps make it easier. * Update index.php Add translations and pretty it up a little. --- core/upgrade/index.php | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/core/upgrade/index.php b/core/upgrade/index.php index 6dde35e29c..a86af90f09 100644 --- a/core/upgrade/index.php +++ b/core/upgrade/index.php @@ -65,10 +65,10 @@ $update_failed = false; } - if (substr_count($response_line, "error") > 0) { + if (substr_count($response_line, "error") > 0) { $update_failed = true; break; - } + } } } if ($update_failed) { @@ -144,7 +144,23 @@ echo " ".$text['label-upgrade_source']; echo " \n"; echo " \n"; - echo "  ".$text['description-upgrade_source']."\n"; + echo "  ".$text['description-upgrade_source']."
\n"; + + // show current git version info + chdir($_SERVER["PROJECT_ROOT"]); + exec("git rev-parse --abbrev-ref HEAD 2>&1", $git_current_branch, $branch_return_value); + $git_current_branch = $git_current_branch[0]; + exec("git log --pretty=format:'%H' -n 1 2>&1", $git_current_commit, $commit_return_value); + $git_current_commit = $git_current_commit[0]; + if (($branch_return_value == 0) && ($commit_return_value == 0)) { + echo $text['label-git_branch'].' '.$git_current_branch." \n"; + //echo $text['label-git_commit'].' '." "; + echo " \n"; + echo $git_current_commit . "
\n"; + echo ""; + } + echo " \n"; echo "\n"; echo "\n"; @@ -251,6 +267,7 @@ echo $_SESSION["schema"]["response"]; unset($_SESSION["schema"]["response"]); } + echo "

"; //include the footer require_once "resources/footer.php";