From b5cf42e8b8a2c85cf21bff952194a3c59007f9d8 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Wed, 28 Mar 2012 12:43:35 +0200 Subject: [PATCH] Show the git revision and git branch in the debug toolbar if available. The git version is displayed for consistency with other locations where the MediaWiki version is displayed and I always the branch on which I am :) Change-Id: Icf041eabe49f03350536f212753e46f8e3468614 --- includes/debug/Debug.php | 2 ++ resources/mediawiki/mediawiki.debug.js | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/includes/debug/Debug.php b/includes/debug/Debug.php index e8ad5261e2..418eede550 100644 --- a/includes/debug/Debug.php +++ b/includes/debug/Debug.php @@ -258,6 +258,8 @@ class MWDebug { $debugInfo = array( 'mwVersion' => $wgVersion, 'phpVersion' => PHP_VERSION, + 'gitRevision' => GitInfo::headSHA1(), + 'gitBranch' => GitInfo::currentBranch(), 'time' => microtime( true ) - $wgRequestTime, 'log' => self::$log, 'debugLog' => self::$debug, diff --git a/resources/mediawiki/mediawiki.debug.js b/resources/mediawiki/mediawiki.debug.js index a2bfbcbe30..2afcbc6f90 100644 --- a/resources/mediawiki/mediawiki.debug.js +++ b/resources/mediawiki/mediawiki.debug.js @@ -159,9 +159,18 @@ paneTriggerBitDiv( 'includes', 'PHP includes', this.data.includes.length ); + var gitInfo = ''; + if ( this.data.gitRevision != false ) { + gitInfo = ' (' + this.data.gitRevision.substring( 0, 7 ) + ')'; + } + bitDiv( 'mwversion' ) .append( $( '' ).text( 'MediaWiki' ) ) - .append( ': ' + this.data.mwVersion ); + .append( ': ' + this.data.mwVersion + gitInfo ); + + if ( this.data.gitBranch != false ) { + bitDiv( 'gitbranch' ).text( 'Git branch: ' + this.data.gitBranch ); + } bitDiv( 'phpversion' ) .append( $( '' ).text( 'PHP' ) ) -- 2.20.1