{"thread":{"id":"25785","subject":"[PATCH 2/4] gitk: Remove unused $cdate array","startedAt":"2010-11-19T07:38:17Z","lastAt":"2010-11-19T07:38:20Z","messageCount":4,"participants":["Anders Kaseorg"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"156155","messageId":"1290152300-21393-1-git-send-email-andersk@mit.edu","threadId":"25785","inReplyTo":null,"subject":"[PATCH 1/4] gitk: Update cherry-pick error message parsing","fromName":"Anders Kaseorg","fromEmail":"andersk@mit.edu","sentAt":"2010-11-19T07:38:17Z","receivedAt":"2010-11-19T07:38:17Z","isPatch":true,"sender":{"key":"andersk@mit.edu","avatar":"https://avatars.githubusercontent.com/u/26471?v=4"},"body":"Commit 981ff5c37ae20687c98d98c8689d5e89016026d2 changed the error\nmessage from git cherry-pick from\n    Automatic cherry-pick failed.  [...advice...]\nto\n    error: could not apply 7ab78c9... Do something neat.\n    [...advice...]\n\nUpdate gitk’s regex to match this, restoring the ability to launch git\ncitool to resolve conflicted cherry-picks.\n\nSigned-off-by: Anders Kaseorg <andersk@mit.edu>\n---\n gitk-git/gitk |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex 1b0e09a..dbc8f86 100644\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -9002,7 +9002,7 @@ proc cherrypick {} {\n \t\t\tto file '%s'.\\nPlease commit, reset or stash\\\n \t\t\tyour changes and try again.\" $fname]\n \t} elseif {[regexp -line \\\n-\t\t       {^(CONFLICT \\(.*\\):|Automatic cherry-pick failed)} \\\n+\t\t       {^(CONFLICT \\(.*\\):|Automatic cherry-pick failed|error: could not apply)} \\\n \t\t       $err]} {\n \t    if {[confirm_popup [mc \"Cherry-pick failed because of merge\\\n \t\t\tconflict.\\nDo you wish to run git citool to\\\n-- \n1.7.3.2\n"},{"id":"156152","messageId":"1290152300-21393-2-git-send-email-andersk@mit.edu","threadId":"25785","inReplyTo":"1290152300-21393-1-git-send-email-andersk@mit.edu","subject":"[PATCH 2/4] gitk: Remove unused $cdate array","fromName":"Anders Kaseorg","fromEmail":"andersk@mit.edu","sentAt":"2010-11-19T07:38:18Z","receivedAt":"2010-11-19T07:38:18Z","isPatch":true,"sender":{"key":"andersk@mit.edu","avatar":"https://avatars.githubusercontent.com/u/26471?v=4"},"body":"It was unused since commit 9f1afe05c3ab7228e21ba3666c6e35d693149b37.\n\nSigned-off-by: Anders Kaseorg <andersk@mit.edu>\n---\n gitk-git/gitk |    5 +----\n 1 files changed, 1 insertions(+), 4 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex dbc8f86..61f2e95 100644\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -1606,7 +1606,7 @@ proc readcommit {id} {\n }\n \n proc parsecommit {id contents listed} {\n-    global commitinfo cdate\n+    global commitinfo\n \n     set inhdr 1\n     set comment {}\n@@ -1656,9 +1656,6 @@ proc parsecommit {id contents listed} {\n \t}\n \tset comment $newcomment\n     }\n-    if {$comdate != {}} {\n-\tset cdate($id) $comdate\n-    }\n     set commitinfo($id) [list $headline $auname $audate \\\n \t\t\t     $comname $comdate $comment]\n }\n-- \n1.7.3.2\n"},{"id":"156154","messageId":"1290152300-21393-3-git-send-email-andersk@mit.edu","threadId":"25785","inReplyTo":"1290152300-21393-1-git-send-email-andersk@mit.edu","subject":"[PATCH 3/4] gitk: Remember time zones from author and commit timestamps","fromName":"Anders Kaseorg","fromEmail":"andersk@mit.edu","sentAt":"2010-11-19T07:38:19Z","receivedAt":"2010-11-19T07:38:19Z","isPatch":true,"sender":{"key":"andersk@mit.edu","avatar":"https://avatars.githubusercontent.com/u/26471?v=4"},"body":"When resolving a conflicted cherry-pick, this lets us pass\nGIT_AUTHOR_DATE to git citool with the correct timezone.\n\nSigned-off-by: Anders Kaseorg <andersk@mit.edu>\n---\n gitk-git/gitk |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex 61f2e95..acdbd21 100644\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -644,7 +644,7 @@ proc newvarc {view id} {\n \tif {![info exists commitinfo($id)]} {\n \t    parsecommit $id $commitdata($id) 1\n \t}\n-\tset cdate [lindex $commitinfo($id) 4]\n+\tset cdate [lindex [lindex $commitinfo($id) 4] 0]\n \tif {![string is integer -strict $cdate]} {\n \t    set cdate 0\n \t}\n@@ -1626,10 +1626,10 @@ proc parsecommit {id contents listed} {\n \tset line [split $line \" \"]\n \tset tag [lindex $line 0]\n \tif {$tag == \"author\"} {\n-\t    set audate [lindex $line end-1]\n+\t    set audate [lrange $line end-1 end]\n \t    set auname [join [lrange $line 1 end-2] \" \"]\n \t} elseif {$tag == \"committer\"} {\n-\t    set comdate [lindex $line end-1]\n+\t    set comdate [lrange $line end-1 end]\n \t    set comname [join [lrange $line 1 end-2] \" \"]\n \t}\n     }\n@@ -10957,7 +10957,7 @@ proc prefsok {} {\n proc formatdate {d} {\n     global datetimeformat\n     if {$d ne {}} {\n-\tset d [clock format $d -format $datetimeformat]\n+\tset d [clock format [lindex $d 0] -format $datetimeformat]\n     }\n     return $d\n }\n-- \n1.7.3.2\n"},{"id":"156153","messageId":"1290152300-21393-4-git-send-email-andersk@mit.edu","threadId":"25785","inReplyTo":"1290152300-21393-1-git-send-email-andersk@mit.edu","subject":"[PATCH 4/4] gitk: Allow displaying time zones from author and commit timestamps","fromName":"Anders Kaseorg","fromEmail":"andersk@mit.edu","sentAt":"2010-11-19T07:38:20Z","receivedAt":"2010-11-19T07:38:20Z","isPatch":true,"sender":{"key":"andersk@mit.edu","avatar":"https://avatars.githubusercontent.com/u/26471?v=4"},"body":"Now gitk can be configured to display author and commit dates in their\noriginal timezone, by putting %z into datetimeformat in ~/.gitk.\n\nSigned-off-by: Anders Kaseorg <andersk@mit.edu>\n---\n gitk-git/gitk |   13 ++++++++++++-\n 1 files changed, 12 insertions(+), 1 deletions(-)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex acdbd21..b67ecc4 100644\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -10957,7 +10957,18 @@ proc prefsok {} {\n proc formatdate {d} {\n     global datetimeformat\n     if {$d ne {}} {\n-\tset d [clock format [lindex $d 0] -format $datetimeformat]\n+\tif {[string match {*%[zZ]*} $datetimeformat]} {\n+\t    if {[catch {set d [clock format [lindex $d 0] -timezone [lindex $d 1] -format $datetimeformat]}]} {\n+\t\t# Tcl < 8.5 does not support -timezone.\n+\t\tglobal env\n+\t\tset zone [lindex $d 1]\n+\t\tset env(TZ) \"IDK[string range $zone 0 2]:[string range $zone 3 end]\"\n+\t\tset d [clock format [lindex $d 0] -format $datetimeformat]\n+\t\tunset env(TZ)\n+\t    }\n+\t} else {\n+\t    set d [clock format [lindex $d 0] -format $datetimeformat]\n+\t}\n     }\n     return $d\n }\n-- \n1.7.3.2\n"}]}