Defect #5151
closed
There is an error in the age calculation for git repositories
Added by Jens Fahnenbruck about 15 years ago.
Updated over 14 years ago.
Description
The time ago of a git commit is decreasing within the first hour or so.
It starts with "about 1 hour ago" and then decreases.
The screenshots were taken 5 minutes apart, the discrepancy is marked in the second screenshot. There you can see that the last commit (marked red) has an age of "about 1 hour ago" and the commit 19 minutes before that (marked green) is 32 minutes old, 5 minutes earlier it was 37 minutes old (see first screenshot)
Files
now with the summer time the difference is two hours but on my local machine I get:
$ date
Mi 7 Apr 2010 00:51:19 CEST
on server I get:
$ date
Wed Apr 7 00:51:27 CEST 2010
except for the language and the seconds it is the same time. but on redmine says the commit is 2 hours from now
I have now found the Problem:
the date string deliverd by git looks like this: "Wed Apr 7 00:50:16 2010 +0200"
in app/views/repositories/_dir_list_content.rhtml:21
distance_of_time_in_words(entry.lastrev.time,Time.now)
entry.lastrev.time = "Wed Apr 7 00:50:16 2010 +0200"
This code class String#to_time on "Wed Apr 07 00:50:16 UTC 2010", but it returns "Wed Apr 07 00:50:16 UTC 2010"
- Status changed from New to Resolved
- % Done changed from 0 to 100
This issue is duplicated with #6346 and fixed by r4187.
- Status changed from Resolved to Closed
- Resolution set to Duplicate
This should be fixed, please open a new issue if this problem still persists.
Thanks for spotting the duplicates, Toshi.
Also available in: Atom
PDF