GNOME Bugzilla – Bug 635312
Dates are displayed in the local time zone instead of the original one
Last modified: 2013-05-02 13:36:21 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.
Created attachment 241982 [details] [review] Show commit author's original time and timezone. My first patch, please review. Thanks!
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.
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.
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.
Hi, Anders Yep, I agree. It's only practical thing for distributed collaborative development to have original timezone info in commits.
Sindhu you've convinced me and I guess Paolo too :) Go ahead and push.
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!
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());
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!
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.
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!
Pushed to master in https://git.gnome.org/browse/gitg/commit/?id=6eb08ef0395620b98175d571dc990e4c55ed5451 Cheers!
Closing bug as bug as has been fixed.