Skip to content

Commit f5974d9

Browse files
anderskpaulusmack
authored andcommitted
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 <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent ef73896 commit f5974d9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

gitk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ proc newvarc {view id} {
659659
if {![info exists commitinfo($id)]} {
660660
parsecommit $id $commitdata($id) 1
661661
}
662-
set cdate [lindex $commitinfo($id) 4]
662+
set cdate [lindex [lindex $commitinfo($id) 4] 0]
663663
if {![string is integer -strict $cdate]} {
664664
set cdate 0
665665
}
@@ -1641,10 +1641,10 @@ proc parsecommit {id contents listed} {
16411641
set line [split $line " "]
16421642
set tag [lindex $line 0]
16431643
if {$tag == "author"} {
1644-
set audate [lindex $line end-1]
1644+
set audate [lrange $line end-1 end]
16451645
set auname [join [lrange $line 1 end-2] " "]
16461646
} elseif {$tag == "committer"} {
1647-
set comdate [lindex $line end-1]
1647+
set comdate [lrange $line end-1 end]
16481648
set comname [join [lrange $line 1 end-2] " "]
16491649
}
16501650
}
@@ -11021,7 +11021,7 @@ proc prefsok {} {
1102111021
proc formatdate {d} {
1102211022
global datetimeformat
1102311023
if {$d ne {}} {
11024-
set d [clock format $d -format $datetimeformat]
11024+
set d [clock format [lindex $d 0] -format $datetimeformat]
1102511025
}
1102611026
return $d
1102711027
}

0 commit comments

Comments
 (0)