Last modified: 2014-02-02 19:04:11 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 T40783, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 38783 - Add git commit date for core and extensions to Special:Version
Add git commit date for core and extensions to Special:Version
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
1.21.x
All All
: Normal enhancement (vote)
: 1.21.0 release
Assigned To: Nobody - You can work on this!
:
: 43354 (view as bug list)
Depends on:
Blocks: 47265 51360 39655 47261 47264 48418 53335
  Show dependency treegraph
 
Reported: 2012-07-28 22:47 UTC by DaSch
Modified: 2014-02-02 19:04 UTC (History)
13 users (show)

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


Attachments

Description DaSch 2012-07-28 22:47:45 UTC
It would be nice, if the date of the last commit of the extension shown on Special:Version could be displayed.
With SVN I could look at the revision number, to check if I have to look for updates. With git this doesn't work. So it would be helpful to see how long an Extension was not updated.
Comment 1 DaSch 2012-07-28 23:38:29 UTC
Maybe like this
https://gerrit.wikimedia.org/r/#/c/16904/
Comment 2 DaSch 2012-09-19 10:50:35 UTC
Patch is there
No Review since 7 Weeks
WONTFIX!?
Comment 3 Daniel Kinzler 2012-10-08 10:42:36 UTC
A new patch, Ib66be27a, is still under review. There doesn't seem to be any fundamental reason not to do this, the patch just needs some tweaking (apparently,y the date format isn't localized or something). 

I for one would live to see this implemented.
Comment 4 taste1at 2012-12-14 17:20:28 UTC
@DaSch:

You write 

date("d.m.Y H:i",$rawdate);

This is a german date format.

The localized date format is available using

$wgLang->date( )   and   $wgLang->time( )

and others, where $wgLang is a global variable storing an instance of the Language class (can be found in /language/Language.php).

Btw, I suggest not to do the formatting in the GitInfo class. This class should return a MediaWiki-timestamp obtained by

date( 'YmdHis', $lastlinearray[4] );

In the class SpecialVersion, you can use $wgLang for formatting. (I'm not sure if the global variable is still to be used but in SpecialVersion lots of them are still around...)
Comment 5 DaSch 2012-12-15 15:35:05 UTC
Okay, I'm out. That's to complicated for me. Gerrit also does not move. I close this, seams I have to live without this.
Comment 6 Andre Klapper 2012-12-15 15:36:37 UTC
Somebody else could still give this a try - reopening.
Comment 7 Dereckson 2012-12-23 22:55:41 UTC
Could you use YYYY-MM-DD ISO 8601 format instead?

This will help a lot to avoid misunderstanding with a unique date format during debug.
Comment 8 Dereckson 2012-12-23 22:57:05 UTC
*** Bug 43354 has been marked as a duplicate of this bug. ***
Comment 9 Dereckson 2012-12-23 22:59:22 UTC
In the bug 43354, we wanted the Special:Version format:

Method | Git revision and date | Description | Authors

________________________________________________________

Example of the 4 columns content:

ParserFunctions (Version 1.4.1)

(8d2534b)
2012-12-22

Enhance parser with logical functions

Tim Starling, Robert Rohde, Ross McClure and Juraj Simlovic

________________________________________________________

As explained in comment 7, I strongly insist for a ISO 8601 date. This is a vital debug information, not something to localize, especially with a risk of day/month confusion.
Comment 10 T. Gries 2013-01-24 06:58:48 UTC
Is someone working on that? I really wish to see the ISO-8601 commit _dates_ close to the version hashes.
Comment 11 Dereckson 2013-01-24 10:05:30 UTC
It seems this should be done in two ways:

(1) ExtensionDistributor. Add a an information file with hash and date.

To get the date:
git show --format="%ci" HEAD | head -n1 | cut -f1 -d ' '

To get the hash (if this is needed, I think the case is well covered by our current class):
git rev-parse HEAD

* * *

(2) If this file is absent and a .git folder is present. The extension has probabably been fetched by a git clone repository. Test we can execute git on the system and get the date.
Comment 12 Andre Klapper 2013-01-24 11:19:23 UTC
[Please don't reset the version field to "unspecified".]

Tom: Do you plan to work on this, or why did you set the Target Milestone?
Comment 13 DaSch 2013-01-24 19:24:10 UTC
There was a patch
There was a gerrit commit
But nobody took care of approving
So I think nobody really is interested in this
Comment 14 T. Gries 2013-01-24 21:28:41 UTC
André, a patch is there: https://gerrit.wikimedia.org/r/#/c/16904/
Comment 15 Andre Klapper 2013-01-25 10:14:40 UTC
Ah thanks! Adding "patch-in-gerrit" keyword...
Comment 16 Andre Klapper 2013-01-25 10:15:35 UTC
https://gerrit.wikimedia.org/r/#/c/17333/ is the latest version of the patch which was abandoned.
Comment 17 Dereckson 2013-01-25 12:11:16 UTC
(In reply to comment #13)
> There was a patch
> There was a gerrit commit
> But nobody took care of approving
> So I think nobody really is interested in this
As I said to you end December, T. Gries and me are interested in this.

* * *

As I indicated in the Ib66be27a review in December, I've tested your patch and it doesn't work as intended.

First, the logs/HEAD file contains other operations than commits. There would have been a need to filter to only process "commit" lines.

But there is a bigger issue: the patch currently reads the .git/logs/HEAD file. This won't always contain the information we want. 

It contains the operation you did to the git repository (e.g. clone, checkout). 

It will only contain the date of the last commit when committed locally.
Comment 18 DaSch 2013-01-25 14:55:48 UTC
4 month after the commit and some days after I said that I'm out of this
by the way I'm not going to ever commit anything to gerrit because this is way to complicated to me and I have no idea of how it works
Comment 19 Andre Klapper 2013-01-25 17:33:44 UTC
(In reply to comment #18)
> 4 month after the commit and some days after I said that I'm out of this
> by the way I'm not going to ever commit anything to gerrit because this is
> way to complicated to me and I have no idea of how it works

DaSch: 
When was the last time you took a look at Gerrit and its documentation at http://www.mediawiki.org/wiki/Gerrit ? Could you elaborate on what's complicated? Your feedback is very welcome to make things easier for you to contribute. Thank you in advance!
Comment 20 DaSch 2013-01-25 18:31:19 UTC
The documentation is for working with command line and I'm working with Eclipse, Aptana and Egit. So the Documentation is worthless and the functions and workflows described there are not available there!
Comment 22 Quim Gil 2013-01-28 16:20:55 UTC
(pressed Save Changes too soon, sorry)

PS: learning how to deal properly with git and code review from your IDE is useful not only for MediaWiki development but also for many other software projects. The first time might be annoying but after that going through the process is trivial.

If you still want to give it a go there is always people happy to help at #mediawiki IRC or wikitech-l mailing list.
https://www.mediawiki.org/wiki/Communication

Thank you for your interest in improving MediaWiki software!
Comment 23 DaSch 2013-02-01 14:54:10 UTC
I make my extensions simple and my own way at github and mediawiki is the only project I contribute a little bit and that's only a bit hacking and Copy Paste Programming because I don't have any experience with PHP only because I have to do it in PHP for mediawiki because I hate PHP.
Comment 24 Andre Klapper 2013-03-20 15:40:22 UTC
Note: As this has the 1.21.0 target milestone set (by Nemo), somebody would have to pick up the patch and rework it. If this does not happen in the next weeks, the Target Milestone will get removed.
Comment 25 DaSch 2013-03-20 18:33:05 UTC
I bet on nobody picking it up!
Comment 26 T. Gries 2013-03-20 21:03:18 UTC
I am working on that now, rebased and made it working (with core / master ).

see screenshot http://i.imgur.com/d9VC08W.png

https://gerrit.wikimedia.org/r/#/c/54902/
Comment 27 T. Gries 2013-03-20 21:09:07 UTC
A screenshot of Special:Version page with this patch is available http://i.imgur.com/d9VC08W.png

and is deployed to 
http://openid-wiki.instance-proxy.wmflabs.org/wiki/Special:Version

where it can be seen in action.
Comment 28 Gerrit Notification Bot 2013-03-20 21:33:07 UTC
Related URL: https://gerrit.wikimedia.org/r/54902 (Gerrit Patch-Set: Ia31a747c0d79f460503f66c369a0d1f2b971b692/5)
Comment 29 Gerrit Notification Bot 2013-03-20 21:33:23 UTC
https://gerrit.wikimedia.org/r/54902 (Gerrit Change Ia31a747c0d79f460503f66c369a0d1f2b971b692) | Code-Review: Reviewed:+1 Patch Set 5: Code-Review+1 [by Wikinaut]
Comment 30 Gerrit Notification Bot 2013-03-20 21:33:54 UTC
https://gerrit.wikimedia.org/r/54902 (Gerrit Change Ia31a747c0d79f460503f66c369a0d1f2b971b692) | Patch Set 5:

A screenshot of Special:Version page with this patch is available http://i.imgur.com/d9VC08W.png

and is deployed to http://openid-wiki.instance-proxy.wmflabs.org/wiki/Special:Version

where it can be seen in action. [by Wikinaut]
Comment 31 Gerrit Notification Bot 2013-03-20 21:35:35 UTC
https://gerrit.wikimedia.org/r/54902 (Gerrit Change Ia31a747c0d79f460503f66c369a0d1f2b971b692) | Code-Review: Reviewed:-1 Patch Set 5: Code-Review-1

(1 comment) [by Catrope]
Comment 33 Gerrit Notification Bot 2013-03-20 21:39:07 UTC
https://gerrit.wikimedia.org/r/54902 (Gerrit Change Ia31a747c0d79f460503f66c369a0d1f2b971b692) | Patch Set 5:

(1 comment)

@DaSch: Catrope asked, why you removed return self::getwgVersionLinked() . " $shortSHA1";

Can you explain ?

I also set to -1 because I want again to check the dates. [by Wikinaut]
Comment 34 Gerrit Notification Bot 2013-03-20 21:39:17 UTC
https://gerrit.wikimedia.org/r/54902 (Gerrit Change Ia31a747c0d79f460503f66c369a0d1f2b971b692) | Code-Review: Reviewed:-1 Patch Set 5: Code-Review-1 [by Wikinaut]
Comment 35 Gerrit Notification Bot 2013-03-20 21:41:57 UTC
https://gerrit.wikimedia.org/r/54902 (Gerrit Change Ia31a747c0d79f460503f66c369a0d1f2b971b692) | Patch Set 5:

(1 comment) [by Wikinaut]
Comment 36 Gerrit Notification Bot 2013-03-20 21:44:38 UTC
Related URL: https://gerrit.wikimedia.org/r/54902 (Gerrit Patch-Set: Ia31a747c0d79f460503f66c369a0d1f2b971b692/6)
Comment 38 Gerrit Notification Bot 2013-03-20 21:49:28 UTC
Related URL: https://gerrit.wikimedia.org/r/54902 (Gerrit Patch-Set: Ia31a747c0d79f460503f66c369a0d1f2b971b692/7)
Comment 39 DaSch 2013-03-20 21:50:08 UTC
(In reply to comment #33)
> https://gerrit.wikimedia.org/r/54902 (Gerrit Change
> Ia31a747c0d79f460503f66c369a0d1f2b971b692) | Patch Set 5:
> 
> (1 comment)
> 
> @DaSch: Catrope asked, why you removed return self::getwgVersionLinked() . "
> $shortSHA1";
> 
> Can you explain ?
> 
> I also set to -1 because I want again to check the dates. [by Wikinaut]

That's not from my patch!

It can't be found here
https://gerrit.wikimedia.org/r/#/c/16904/
nor here
https://gerrit.wikimedia.org/r/#/c/17333/
Comment 41 Gerrit Notification Bot 2013-03-20 22:01:07 UTC
https://gerrit.wikimedia.org/r/54902 (Gerrit Change Ia31a747c0d79f460503f66c369a0d1f2b971b692) | Code-Review: Reviewed:-1 Patch Set 7: Code-Review-1

The following comment by Dereckson is important:
https://bugzilla.wikimedia.org/show_bug.cgi?id=38783#c17

*** I hereby withdraw (abandon) that patch set, because it indeed does not work as intended, Well, it shows a date, but not necessarily the commit date, or edit date. ***


Dereckson wrote:

As I indicated in the Ib66be27a review in December, I've tested your patch and
it doesn't work as intended.

First, the logs/HEAD file contains other operations than commits. There would
have been a need to filter to only process "commit" lines.

But there is a bigger issue: the patch currently reads the .git/logs/HEAD file.
This won't always contain the information we want. 

It contains the operation you did to the git repository (e.g. clone, checkout). 

It will only contain the date of the last commit when committed locally. [by Wikinaut]
Comment 42 Gerrit Notification Bot 2013-03-20 22:02:18 UTC
https://gerrit.wikimedia.org/r/54902 (Gerrit Change Ia31a747c0d79f460503f66c369a0d1f2b971b692) | change ABANDONED [by Wikinaut]
Comment 43 Gerrit Notification Bot 2013-03-20 22:05:36 UTC
Related URL: https://gerrit.wikimedia.org/r/54986 (Gerrit Patch-Set: I0931400ecacf91ed2ab4fc7aa46dceac17661768/1)
Comment 44 Gerrit Notification Bot 2013-03-20 22:16:57 UTC
Related URL: https://gerrit.wikimedia.org/r/54986 (Gerrit Patch-Set: I0931400ecacf91ed2ab4fc7aa46dceac17661768/2)
Comment 45 Gerrit Notification Bot 2013-03-20 22:23:49 UTC
Related URL: https://gerrit.wikimedia.org/r/54986 (Gerrit Patch-Set: I0931400ecacf91ed2ab4fc7aa46dceac17661768/3)
Comment 46 DaSch 2013-03-20 22:33:11 UTC
what Dereckson want's is only possible by connecting to remote within the PHP Skript

git information in .git only have local changes.

The information from logs/HEAD contains the last git operation. And that is exactly what is needed. But only there I see how long I didn't check for an update. Because when I take the date from the commit I always think that I have to pull for new updates just because there where no changes for a long time!
Comment 47 T. Gries 2013-03-20 22:38:57 UTC
(In reply to comment #46)
> what Dereckson want's is only possible by connecting to remote within the PHP
> Skript
> 
> git information in .git only have local changes.
> 

I think, you are right -- this is, what I also think is needed (fetching the dates from the remote). 

So in summary, the present solution is the best possible local solution.

Url will be added, when the (draft) patch is published.

> The information from logs/HEAD contains the last git operation. And that is
> exactly what is needed. But only there I see how long I didn't check for an
> update. Because when I take the date from the commit I always think that I
> have
> to pull for new updates just because there where no changes for a long time!
Comment 48 Gerrit Notification Bot 2013-03-20 22:43:47 UTC
Related URL: https://gerrit.wikimedia.org/r/54986 (Gerrit Patch-Set: I0931400ecacf91ed2ab4fc7aa46dceac17661768/4)
Comment 49 Gerrit Notification Bot 2013-03-20 22:44:39 UTC
Related URL: https://gerrit.wikimedia.org/r/54986 (Gerrit Patch-Set: I0931400ecacf91ed2ab4fc7aa46dceac17661768/5)
Comment 50 Gerrit Notification Bot 2013-03-20 22:45:16 UTC
Related URL: https://gerrit.wikimedia.org/r/54986 (Gerrit Patch-Set: I0931400ecacf91ed2ab4fc7aa46dceac17661768/6)
Comment 51 Gerrit Notification Bot 2013-03-20 22:45:59 UTC
Related URL: https://gerrit.wikimedia.org/r/54986 (Gerrit Patch-Set: I0931400ecacf91ed2ab4fc7aa46dceac17661768/7)
Comment 52 Gerrit Notification Bot 2013-03-20 22:46:18 UTC
Related URL: https://gerrit.wikimedia.org/r/54986 (Gerrit Patch-Set: I0931400ecacf91ed2ab4fc7aa46dceac17661768/8)
Comment 53 Gerrit Notification Bot 2013-03-20 22:48:30 UTC
Related URL: https://gerrit.wikimedia.org/r/54986 (Gerrit Patch-Set: I0931400ecacf91ed2ab4fc7aa46dceac17661768/9)
Comment 54 Kevin Israel (PleaseStand) 2013-03-20 22:55:23 UTC
(In reply to comment #46)
> what Dereckson want's is only possible by connecting to remote within the PHP
> Skript
> 
> git information in .git only have local changes.

Commit dates are stored as part of the commit objects, so they are available locally. However, commit objects can be (and often are) part of packfiles, so reading them is not easy (unless of course you shell out to `git`).
Comment 55 T. Gries 2013-03-23 10:03:25 UTC
A working version is now available in 
https://gerrit.wikimedia.org/r/#/c/54986/

Screenshot http://i.imgur.com/z3RvMiB.png shows, how the Special:Version page looks when the patch is applied.

It has to *** shell out *** and makes use of the "git show" command to let git do the work to fetch and format author and commit dates. Any other solution is PITA, I investigated different alternatives and all of them are even worse.
Comment 56 Daniel Friesen 2013-03-23 13:15:28 UTC
(In reply to comment #7)
> Could you use YYYY-MM-DD ISO 8601 format instead?
> 
> This will help a lot to avoid misunderstanding with a unique date format
> during
> debug.

(In reply to comment #9)

> As explained in comment 7, I strongly insist for a ISO 8601 date. This is a
> vital debug information, not something to localize, especially with a risk of
> day/month confusion.

We localize dates everywhere by the user's preference. RC, contribs, histories, etc... even our old code review system uses localized dates.

Dates are localized according to the user's choice, they should know how to read it. In fact none of the date preference options we give are ambiguous. And if YOU don't like seeing localized dates you can set your preferences to show ISO dates.

Is there any real reason not to localize the date as our standard is?
Comment 57 T. Gries 2013-03-23 13:19:11 UTC
(In reply to comment #56)
> (In reply to comment #7)
 Dates are localized according to the user's choice, they should know how to
> read it. In fact none of the date preference options we give are ambiguous.
> And
> if YOU don't like seeing localized dates you can set your preferences to show
> ISO dates.
> 
> Is there any real reason not to localize the date as our standard is?

Daniel, please simply change the two lines in SpecialVersion.php as you like to have it --- I want to finish this story, successfully and soon. Pls.
Comment 58 T. Gries 2013-04-05 08:36:38 UTC
patch available https://gerrit.wikimedia.org/r/#/c/54986/ . pls. can someone review and commit?
Comment 59 Andre Klapper 2013-04-05 10:13:20 UTC
T. Gries: Why did you bomp the Target Milestone from 1.21 to 1.22?
Comment 60 T. Gries 2013-04-05 10:38:00 UTC
(In reply to comment #59)
> T. Gries: Why did you bomp the Target Milestone from 1.21 to 1.22?

André: because I thought that the 1.21 train was already gone... (reset to 1.21 milestone). Perhaps you can help to get this in, thanks.
Comment 61 T. Gries 2013-04-08 22:22:15 UTC
(In reply to comment #59)
> T. Gries: Why did you bomp the Target Milestone from 1.21 to 1.22?

@André:

because this bug is - apparently currently - not part of https://www.mediawiki.org/wiki/Release_notes/1.21 !
Comment 62 Andre Klapper 2013-04-09 09:20:35 UTC
Of course - 1.21 is not even released, so release notes are work in progress. :)
Comment 63 T. Gries 2013-04-09 17:48:58 UTC
(In reply to comment #62)
> Of course - 1.21 is not even released, so release notes are work in progress.
> :)

ok,. did not know, and added it now https://www.mediawiki.org/w/index.php?title=Release_notes%2F1.21&diff=671485&oldid=667144
Comment 64 Andre Klapper 2013-04-09 19:56:34 UTC
T. Gries: Errm, but the patch is not merged, so it's NOT part of 1.21 yet, and IMO it should not be part of the release notes yet either.
Comment 65 T. Gries 2013-04-09 20:27:10 UTC
(In reply to comment #64)
> T. Gries: Errm, but the patch is not merged, so it's NOT part of 1.21 yet,
> and
> IMO it should not be part of the release notes yet either.

merge it
Comment 66 T. Gries 2013-04-10 08:19:22 UTC
current code is live on http://openid-wiki.instance-proxy.wmflabs.org/wiki/Special:Version

@PleaseStand: See your comment to patch set 31 https://gerrit.wikimedia.org/r/#/c/54986/31/includes/GitInfo.php in Line 131

The present commit implements your proposal to have $wgGitBin as DefaultSetting parameter, which prevents multiple exec failures in Special:Versions when this command is not available. Thanks for pointing me to this.
Comment 67 T. Gries 2013-04-15 20:59:24 UTC
committed with https://gerrit.wikimedia.org/r/#/c/54986/
Comment 68 Jamie Thingelstad 2013-05-13 20:01:15 UTC
I realize this commit has already been merged in, but it would be really nice if this information were also exposed in the API call for extensions

api.php?action=query&meta=siteinfo&siprop=extensions
Comment 69 Dereckson 2013-05-13 20:10:02 UTC
This is indeed a good idea.

I opened a new feature request on bug 48418.

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


Navigation
Links