Defect #4115

repositories/show/project-name Ages off by timezone delta

Added by Marc Mengel almost 8 years ago. Updated over 6 years ago.

Status:ClosedStart date:2009-10-26
Priority:NormalDue date:
Assignee:-% Done:

50%

Category:SCM
Target version:-
Resolution:Duplicate Affected version:0.8.4

Description

In our redmine 0.8.4 installation, when you go to the
repositories/show/project-name page, the Age column shows
a delta-time value which is off by the timezone delta from GMT.
(in our case currently 5 hours -- that is a change made
a minute ago lists as 5 hours ago).

If you click on the revision next to that Age entry, on the
revision page /repositories/revision/project-name/revisionkey
the correct delta time is shown, so this is restricted to just
that repositories/show/project-name page. This happens both
in Git and CVS repositories, and so appears not to be a bug
in the backends.


Related issues

Related to Redmine - Defect #3761: Most recent CVS revisions are missing in "revisions" view Closed 2009-08-19

History

#1 Updated by Marc Mengel almost 8 years ago

I wanted to note that this doesn't change when I change my timezone as a user, the offset remains...
I should also mention that this is 0.8.4 plus:
http://www.redmine.org/projects/redmine/repository/revisions/2840/
http://www.redmine.org/issues/4003
http://www.redmine.org/issues/4002

#2 Updated by Shawn Nock almost 8 years ago

Confirming this bug at my site. Same symptoms... age off by delta from UTC.

#3 Updated by Shawn Nock almost 8 years ago

Adding that I am running HEAD current to a few hours ago...

#4 Updated by Jean-Philippe Lang almost 8 years ago

  • Category set to SCM

#5 Updated by Chris Suter over 7 years ago

Subject: [PATCH] Fixed timezone issue with last revision

---
lib/redmine/scm/adapters/git_adapter.rb | 4 +--
1 files changed, 2 insertions(
), 2 deletions(-)

diff --git a/lib/redmine/scm/adapters/git_adapter.rb b/lib/redmine/scm/adapters/git_adapter.rb
index 14e1674..928ae1c 100644
--- a/lib/redmine/scm/adapters/git_adapter.rb
+++ b/lib/redmine/scm/adapters/git_adapter.rb
@ -85,7 +85,7 @ module Redmine

def lastrev(path,rev)
return nil if path.nil?
- cmd = "#{GIT_BIN} --git-dir #{target('')} log --pretty=fuller --no-merges n 1 "
+ cmd = "#{GIT_BIN} --git-dir #{target('')} log --pretty=fuller --no-merges -n 1 --date=iso"
cmd << " #{shell_quote rev} " if rev
cmd << "-
#{path} " unless path.empty?
shellout(cmd) do |io|
@ -93,7 +93,7 @ module Redmine
id = io.gets.split[1]
author = io.gets.match('Author:\s+(.*)$')[1]
2.times { io.gets }
- time = io.gets.match('CommitDate:\s+(.*)$')[1]
+ time = Time.parse(io.gets.match('CommitDate:\s+(.*)$')[1])
Revision.new({
:identifier => id,
--
1.6.3.3

#6 Updated by Toshi MARUYAMA almost 7 years ago

  • % Done changed from 0 to 50

Git problem is reported at #6346 and fixed by r4187.

#7 Updated by Felix Schäfer almost 7 years ago

  • Status changed from New to Closed
  • Resolution set to Duplicate

This should be fixed, please open a new issue if this problem still persists.

#8 Updated by Toshi MARUYAMA over 6 years ago

I confirmed CVS has this problem. I create new issue #7827.

Also available in: Atom PDF