Ensure that GitInfo::getHead returns a valid value before attempting to
use the git binary to extract a commit date.
Bug: 64948
Change-Id: Ib0d245306842706dbb5d4b9522bb381a5f55526c
Support reading git repository information from a JSON file in the cache
directory. When present, this file serves to provide information needed
by getHead, getHeadSHA1, getHeadCommitDate, getCurrentBranch and a new
getRemoteUrl method. A GitInfo::precomputeValues method is also provided
which can generate the cache file for a given GitInfo instance.
This support can be combined with a deployment step to reduce the need
to repeatedly gather information from the .git files/git binary. It also
allows computing information that can be lost when directory structures
differ between deployment staging hosts and hosts running MediaWiki.
This change also adds memoization of computed values for a given GitInfo
instance which may provide a small performance boost even for
deployments which are not using precomputed cache files.
Bug: 53972
Change-Id: I66e058acc5a71e5d82644f85d819f49d6ee9d1e6
It's possible to have a ')' in a .git/config file, but
parse_ini_file will claim that's invalid and display a warning.
Also prevent another warning from occurring if the parse_ini_file
failed and $configArray is null.
Change-Id: Iba54220be266cb885e83cddfa6c8e9782aa77d01
- Place commas correct
- Moved comments
- Add space after if/foreach/catch
- Reformat some conditions
- Removed trailing spaces/tabs
Change-Id: I40ccda72c418c4a33fcd675773cb08d971510cdb
The patch adds the localised commit date of i) core and ii) extensions
in the Special:Version page tables. It requires the Git version control
system being installed, which is checked during the installation.
Introduces a new parameter for the git binary in DefaultSettings.php:
$wgGitBin = '/usr/bin/git';
Patch authored by DaSch <dasch@daschmedia.de> and updated and fixed
by Wikinaut<mail@tgries.de>.
Bug: 38783
Change-Id: I0931400ecacf91ed2ab4fc7aa46dceac17661768
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.
Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
On my windows under eclipse with EGit there is a directory named .git,
but that gives warning, when read with file_get_contents:
Warning: file_get_contents(/.git) [function.file-get-contents]: failed
to open stream: Permission denied in \includes\GitInfo.php on line 49
Follow up Ieb79c0b4
Change-Id: I7c3ba323460a2fd3739d3912ee6420aa29311f4f
I implemented "the gitfile mechanism" in the GitInfo class so it
can access gitdirs for submodules again.
Bug: 44599
Change-Id: Ieb79c0b401a6bb0f5ca8bff98bb382a8c6ffbb01
My git remote is configured just to be ssh://review/mediawiki/core.git
and I have "review" set up in $HOME/.ssh/config.
Unfortunately, I need to change git remote URLs to make sure
the repository is linked from Special:Version.
This shouldn't be necessary; either we should fallback to the
official MediaWiki git repository or we should add the configuration
option to adapt to local needs.
Change-Id: I2e0b6470c16ec36d0e94cceab844f4a4c4334067
This adds a GitViewers hook to GitInfo, and slightly refactors the
$viewers variable to be called through a function so the hook can be
called. This is so extensions can add their own git repository viewer
to the Special:Version git sha field.
Change-Id: Ifc8396984de6a51be85fb63cd9754d57333bde03
Now that there is a link on the revision hash in Special:Version, do the same in the debug toolbar.
Change-Id: I953ac70e17e72be68251e3908e164dfa46c68bf5
The URL we are crafting are using a short sha1 (7 chars long) which can
have some good chance of pointing to two different sha1. I have seen git
log to use 8 chars from time to time because of sha1 collisions, 62
occurences outu of 45315 commits as of now.
So to play it safe, this patch makes the URL points to the full sha1.
Follow https://gerrit.wikimedia.org/r/43355734eac351 (commit)
9afc1eff1c (merge)
Change-Id: Ic65d0ca89916fe43999b9e3f257d9f322198f9f8
This adds GitInfo which is used by Special:Version to get the SHA1 of
the git repo.
It's also useful for development to put blocks of config in
LocalSettings.php that only apply to branches where you are developing
large features:
if ( GitInfo::currentBranch() == 'myrewriteproject' ) {
// […]
}
Change-Id: I2a76662bb40080be6556d4edf60ac6714f36a727