git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arjen Laarhoven <arjen@yaph.org>
To: Paul Mackerras <paulus@samba.org>
Cc: Git Mailing List <git@vger.kernel.org>, Arjen Laarhoven <arjen@yaph.org>
Subject: [PATCH] gitk: Make the date/time display configurable
Date: Tue, 14 Aug 2007 22:02:04 +0200	[thread overview]
Message-ID: <11871217241055-git-send-email-arjen@yaph.org> (raw)

The new 'datetimeformat' configuration variable in ~/.gitk can be set
to a Tcl 'clock format' format string to modify the display of dates
and times.

http://www.tcl.tk/man/tcl8.4/TclCmd/clock.htm has a list of allowed
fields.

Signed-off-by: Arjen Laarhoven <arjen@yaph.org>
---
 gitk |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/gitk b/gitk
index f74ce51..98bee51 100755
--- a/gitk
+++ b/gitk
@@ -967,7 +967,7 @@ proc savestuff {w} {
     global stuffsaved findmergefiles maxgraphpct
     global maxwidth showneartags showlocalchanges
     global viewname viewfiles viewargs viewperm nextviewnum
-    global cmitmode wrapcomment
+    global cmitmode wrapcomment datetimeformat
     global colors bgcolor fgcolor diffcolors selectbgcolor
 
     if {$stuffsaved} return
@@ -985,6 +985,7 @@ proc savestuff {w} {
 	puts $f [list set wrapcomment $wrapcomment]
 	puts $f [list set showneartags $showneartags]
 	puts $f [list set showlocalchanges $showlocalchanges]
+	puts $f [list set datetimeformat $datetimeformat]
 	puts $f [list set bgcolor $bgcolor]
 	puts $f [list set fgcolor $fgcolor]
 	puts $f [list set colors $colors]
@@ -7249,8 +7250,9 @@ proc prefsok {} {
 }
 
 proc formatdate {d} {
+    global datetimeformat
     if {$d ne {}} {
-	set d [clock format $d -format "%Y-%m-%d %H:%M:%S"]
+	set d [clock format $d -format $datetimeformat]
     }
     return $d
 }
@@ -7563,6 +7565,7 @@ set showneartags 1
 set maxrefs 20
 set maxlinelen 200
 set showlocalchanges 1
+set datetimeformat "%Y-%m-%d %H:%M:%S"
 
 set colors {green red blue magenta darkgrey brown orange}
 set bgcolor white
-- 
1.5.3.rc4.67.gf9286

                 reply	other threads:[~2007-08-14 20:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11871217241055-git-send-email-arjen@yaph.org \
    --to=arjen@yaph.org \
    --cc=git@vger.kernel.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).