gitk: Remember time zones from author and commit timestamps

When resolving a conflicted cherry-pick, this lets us pass GIT_AUTHOR_DATE to git citool with the correct timezone. It does this by making elements 2 and 4 of the commitinfo array entries, which store the author and committer dates of the commit, be 2-element lists storing the numerical date and timezone offset, rather than just the numerical date. Signed-off-by: Anders Kaseorg <andersk@mit.edu> Signed-off-by: Paul Mackerras <paulus@samba.org>

Anders Kaseorg committed Jan 19, 2011 at 14:47 UTC f5974d97af06bca1382c585a515c8e1920333eb7
1 file changed +4 -4
gitk
+4 -4
@@ -659,7 +659,7 @@ proc newvarc {view id} {
659 if {![info exists commitinfo($id)]} {
660 parsecommit $id $commitdata($id) 1
661 }
662 - set cdate [lindex $commitinfo($id) 4]
662 + set cdate [lindex [lindex $commitinfo($id) 4] 0]
663 if {![string is integer -strict $cdate]} {
664 set cdate 0
665 }
@@ -1641,10 +1641,10 @@ proc parsecommit {id contents listed} {
1641 set line [split $line " "]
1642 set tag [lindex $line 0]
1643 if {$tag == "author"} {
1644 - set audate [lindex $line end-1]
1644 + set audate [lrange $line end-1 end]
1645 set auname [join [lrange $line 1 end-2] " "]
1646 } elseif {$tag == "committer"} {
1647 - set comdate [lindex $line end-1]
1647 + set comdate [lrange $line end-1 end]
1648 set comname [join [lrange $line 1 end-2] " "]
1649 }
1650 }
@@ -11021,7 +11021,7 @@ proc prefsok {} {
11021 proc formatdate {d} {
11022 global datetimeformat
11023 if {$d ne {}} {
11024 - set d [clock format $d -format $datetimeformat]
11024 + set d [clock format [lindex $d 0] -format $datetimeformat]
11025 }
11026 return $d
11027 }