Skip to content

Commit 76486bb

Browse files
committed
git-gui: Format author/committer times in ISO format
This is a simple change to match what gitk does when it shows a commit; we format using ISO dates (yyyy-mm-dd HH:MM:SS). Signed-off-by: Shawn O. Pearce <[email protected]>
1 parent 0511798 commit 76486bb

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

lib/blame.tcl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,14 +347,20 @@ method _showcommit {lno} {
347347
set author_time {}
348348
catch {set author_name $header($cmit,author)}
349349
catch {set author_email $header($cmit,author-mail)}
350-
catch {set author_time [clock format $header($cmit,author-time)]}
350+
catch {set author_time [clock format \
351+
$header($cmit,author-time) \
352+
-format {%Y-%m-%d %H:%M:%S}
353+
]}
351354

352355
set committer_name {}
353356
set committer_email {}
354357
set committer_time {}
355358
catch {set committer_name $header($cmit,committer)}
356359
catch {set committer_email $header($cmit,committer-mail)}
357-
catch {set committer_time [clock format $header($cmit,committer-time)]}
360+
catch {set committer_time [clock format \
361+
$header($cmit,committer-time) \
362+
-format {%Y-%m-%d %H:%M:%S}
363+
]}
358364

359365
if {[catch {set msg $header($cmit,message)}]} {
360366
set msg {}
@@ -383,8 +389,8 @@ method _showcommit {lno} {
383389
}
384390

385391
$w_cmit insert end "commit $cmit
386-
Author: $author_name $author_email $author_time
387-
Committer: $committer_name $committer_email $committer_time
392+
Author: $author_name $author_email $author_time
393+
Committer: $committer_name $committer_email $committer_time
388394
Original File: [escape_path $line_file($lno)]
389395
390396
$msg"

0 commit comments

Comments
 (0)