Last modified: 2014-01-26 20:14:34 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T41825, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 39825 - Special:Version can warn about '#' comments in .git/config
Special:Version can warn about '#' comments in .git/config
Status: REOPENED
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
1.20.x
All All
: Low minor (vote)
: ---
Assigned To: Karun
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-31 05:32 UTC by spage
Modified: 2014-01-26 20:14 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description spage 2012-08-31 05:32:23 UTC
I upgraded to MediaWiki wmf/1.20wmf10 and now Special:Version prints the following deprecation warning, one I don't recall seeing before, about my .git/config file in one of my extensions:
  Deprecated: Comments starting with '#' are deprecated in  .../extensions/E3Experiments/.git//config on line 6 in .../includes/GitInfo.php on line 139".

I do have a # comment line in that config file.  But '#' is a completely legit comment symbol in .git/config [1].  GitInfo.php invokes PHP's parse_ini_file() which in PHP 5.3 deprecates '#'.[2]

The workaround is to use ';' for comments in .git/config.

[1] http://www.kernel.org/pub/software/scm/git/docs/git-config.html#_syntax
[2] http://php.net/manual/en/function.parse-ini-file.php
Comment 1 Karun 2012-12-19 13:06:01 UTC
Normally the git files should not be a part of the extensions installation, and this is not an issue with Mediawiki. So closing as invalid.
Comment 2 spage 2012-12-20 04:15:23 UTC
(In reply to comment #1)
> Normally the git files should not be a part of the extensions installation,
If someone follows instructions such as http://www.mediawiki.org/wiki/Download_from_Git to download an extension from git, they will in fact have a .git/config file.  If they then make modifications to it, they can encounter this error when they visit Special:Version

> and this is not an issue with Mediawiki.
This is a real, although minor, bug in the way GitInfo.php works.  I don't mind if a developer (FWIW `git blame` suggests Alexandre Emsenhuber wrote the code) chooses to close this as WONTFIX, but it's not invalid.  So reopening.
Comment 3 Karun 2012-12-20 12:54:24 UTC
(In reply to comment #0)
> I upgraded to MediaWiki wmf/1.20wmf10 and now Special:Version prints the
> following deprecation warning, one I don't recall seeing before, about my
> .git/config file in one of my extensions:
>   Deprecated: Comments starting with '#' are deprecated in 
> .../extensions/E3Experiments/.git//config on line 6 in
> .../includes/GitInfo.php
> on line 139".
> 
> I do have a # comment line in that config file.  But '#' is a completely
> legit
> comment symbol in .git/config [1].  GitInfo.php invokes PHP's
> parse_ini_file()
> which in PHP 5.3 deprecates '#'.[2]
> 
> The workaround is to use ';' for comments in .git/config.
> 
> [1] http://www.kernel.org/pub/software/scm/git/docs/git-config.html#_syntax
> [2] http://php.net/manual/en/function.parse-ini-file.php

Hello,
I am trying to reproduce this problem with PHP 5.4 and MediaWiki, but I dont get this error. Do you have any further details on how to reproduce it?
Comment 4 Karun 2013-06-10 04:22:39 UTC
Unable to reproduce the problem, and no further response has been received.
Comment 5 Kevin Israel (PleaseStand) 2013-06-10 04:55:05 UTC
Steps to Reproduce:

1. Clone the mediawiki/core Git repo, and install MediaWiki
2. Add the line "# testing 123" to .git/config
3. In php.ini, set error_reporting = E_ALL
4. Visit Special:Version

Actual Results:

I get this error message:

Deprecated: Comments starting with '#' are deprecated in /home/ki/Projects/mediawiki/core/.git/config on line 27 in /home/ki/Projects/mediawiki/core/includes/GitInfo.php on line 173

Expected Results:

No error message should appear. Comments beginning with '#' are not
described as "deprecated" in the git-config(1) manual page.

https://www.kernel.org/pub/software/scm/git/docs/git-config.html#_syntax
Comment 6 Karun 2014-01-26 20:14:34 UTC
As we use the php_parse_ini method to read the git configuration file, we always throw a deprecation error if a # is encountered.

Due to this change to the PHP method in 5.3.0.

5.3.0 	Added optional scanner_mode parameter. Single quotes may now be used around variable assignments. Hash marks (#) may no longer be used as comments and will throw a deprecation warning if used. 

Therefore we need to look at some other method of parsing the file, or ignoring this error.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links