From: Alexandre Emsenhuber Date: Wed, 28 Mar 2012 10:43:35 +0000 (+0200) Subject: Show the git revision and git branch in the debug toolbar if available. X-Git-Tag: 1.31.0-rc.0~24102^2 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=b5cf42e8b8a2c85cf21bff952194a3c59007f9d8;p=lhc%2Fweb%2Fwiklou.git 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 --- 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' ) )