aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rev.php27
1 files changed, 4 insertions, 23 deletions
diff --git a/rev.php b/rev.php
index 2b40a3cfb..00b9a6d7c 100644
--- a/rev.php
+++ b/rev.php
@@ -15,7 +15,7 @@ $app_root = __DIR__;
$vars = array(
'app' => $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'],
- 'svn' => get_svn_info($app_root),
+ 'git' => get_git_info($app_root),
'status' => get_status($app_root),
);
@@ -43,30 +43,11 @@ function get_status($app_root)
*
* @return array
*/
-function get_svn_info($app_root)
+function get_git_info($app_root)
{
- exec(escapeshellcmd(sprintf('LC_ALL=C %s info %s', exec('which svn'), escapeshellarg($app_root))),
+ exec(escapeshellcmd(sprintf('LC_ALL=C %s show %s %s', exec('which git'), '-s --pretty="Revision: %H%nLast Author: %an%nDate Revision: %ar%nTitle: %s"', escapeshellarg($app_root))),
$out, $ret);
- $vars = array();
- $keys = array(
- 'URL',
- 'Revision',
- 'Last Changed Author',
- 'Last Changed Rev',
- 'Last Changed Date'
- );
- foreach ($out as $l) {
- $l = explode(':', trim($l));
- $k = trim(array_shift($l));
- if (in_array($k, $keys))
- $vars[strtolower(str_replace(' ', '_', $k))] = trim(implode(':', $l));
- }
- // remove scheme & user; keep it?
- $u = $vars['url'];
- $u = parse_url($u);
- $vars['url'] = sprintf('%s%s', $u['host'], $u['path']);
-
- return $vars;
+ return $out;
}