After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 635312 - Dates are displayed in the local time zone instead of the original one
Dates are displayed in the local time zone instead of the original one
Status: RESOLVED FIXED
Product: gitg
Classification: Applications
Component: gitg
git master
Other Linux
: Normal minor
: ---
Assigned To: gitg-maint
gitg-maint
Depends on:
Blocks:
 
 
Reported: 2010-11-19 21:58 UTC by Anders Kaseorg
Modified: 2013-05-02 13:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Show commit author's original time and timezone. (1.60 KB, patch)
2013-04-20 11:31 UTC, Sindhu S
none Details | Review
Show commit author's time and timezone in diff view and remove obsolete code. (2.46 KB, patch)
2013-04-23 06:39 UTC, Sindhu S
needs-work Details | Review
Remove unused variable. (2.42 KB, patch)
2013-04-23 08:55 UTC, Sindhu S
none Details | Review
Show commit author's time and zone in commit log and diff view (3.54 KB, patch)
2013-04-23 10:50 UTC, Sindhu S
none Details | Review

Description Anders Kaseorg 2010-11-19 21:58:10 UTC
Git author and committer dates have associated time zones, but gitg ignores them and converts all dates into the local time zone.  It would be nice if gitg had the ability to display dates in their original time zone, like the git command line tools do by default.
Comment 1 Sindhu S 2013-04-20 11:31:39 UTC
Created attachment 241982 [details] [review]
Show commit author's original time and timezone.

My first patch, please review. Thanks!
Comment 2 Paolo Borelli 2013-04-20 12:30:39 UTC
The patch looks ok, though I have not checked carefully since I am not familiar with the api uses in that part.


However I do not quite see the point of the original request... I am surely more interested in seeing that a patch was done two hours ago in *my* timezone than to know that it was authored at 8AM in tokio while having breakfast.
Comment 3 Sindhu S 2013-04-20 12:39:04 UTC
Hi, Paolo!

The commit log still shows time and timezone with respect to your local time and timezone. 
The time and timezone displayed in the commit, I think should be in the author's time and timezone. It's best explained in this scenario:

Developer A (Tokyo) and Developer B (USA) have a conversation:

Developer B: Hey! Could you please take a look at the commit you made yesterday at noon? It broke our builds!
Developer A: Noon? I maden no commit at noon! I made a commit in the morning. 

This is the behaviour in `git log` too.
Comment 4 Anders Kaseorg 2013-04-20 14:09:00 UTC
gitg should have the ability to show you the entire state of your repository, and the commit timezones are part of that.  If you hide some information from users, they might wonder what else you’re hiding from them, which complicates the formation of a mental model and makes it harder to learn to use Git well.

Worse, showing local times with an attached timezone (09:12:34 EST), as gitg does now, makes it unclear at first glance that you’re even hiding anything.
Comment 5 Sindhu S 2013-04-20 19:28:17 UTC
Hi, Anders

Yep, I agree. It's only practical thing for distributed collaborative development to have original timezone info in commits.
Comment 6 Ignacio Casal Quinteiro (nacho) 2013-04-21 09:41:44 UTC
Sindhu you've convinced me and I guess Paolo too :)
Go ahead and push.
Comment 7 Sindhu S 2013-04-23 06:39:43 UTC
Created attachment 242191 [details] [review]
Show commit author's time and timezone in diff view and remove obsolete code.

Show commit author's time and timezone in diff view and remove obsolete code.

As spoken on IRC channel #gitg yesterday, Ignacio, I have removed the code that is no longer relevant. Please review again and confirm if to push to master. Thanks!
Comment 8 Ignacio Casal Quinteiro (nacho) 2013-04-23 08:18:46 UTC
Review of attachment 242191 [details] [review]:

See comment inline.

::: libgitg-gtk/gitg-gtk-diff-view-request-diff.vala
@@ +194,2 @@
 			builder.set_member_name("time");
+			var authorLocalTime = sig.get_time().to_timezone(sig.get_time_zone());

I think the patch should be just:
builder.add_int_value(sig.get_time().to_timezone(sig.get_time_zone().to_unix());
Comment 9 Sindhu S 2013-04-23 08:55:06 UTC
Created attachment 242195 [details] [review]
Remove unused variable.

The previous patch created a new variable for readability sakes. I have removed it as suggested. Please review again, thanks!
Comment 10 Sindhu S 2013-04-23 09:11:19 UTC
The reason I fixed it here (in the place where the date is being passed to webkit) is this:

1. The commit log tree view will show the time in "X Hours ago" format, which is very useful. and it is useful to have all the times here in the same timezone.

2. I thought changing it somewhere else might break this functionality, since gitg-commit.vala was being re-used, and opted for the smallest change.
Comment 11 Sindhu S 2013-04-23 10:50:44 UTC
Created attachment 242204 [details] [review]
    Show commit author's time and zone in commit log and diff view 

Changed as pbor and nacho suggested on #gitg. 
Please review. Thanks!
Comment 12 Sindhu S 2013-04-23 11:58:58 UTC
Pushed to master in https://git.gnome.org/browse/gitg/commit/?id=6eb08ef0395620b98175d571dc990e4c55ed5451

Cheers!
Comment 13 Sindhu S 2013-05-02 13:36:21 UTC
Closing bug as bug as has been fixed.