From: Pat Thoyts <patthoyts@users.sourceforge.net>
To: Paul Mackerras <paulus@samba.org>
Cc: Steve Wagner <lists@lanwin.de>, git@vger.kernel.org
Subject: Re: .gitk should created hidden in windows
Date: Tue, 24 Mar 2009 01:04:07 +0100 [thread overview]
Message-ID: <49C82377.40101@users.sourceforge.net> (raw)
In-Reply-To: <18887.26239.115820.450313@cargo.ozlabs.ibm.com>
Paul Mackerras wrote:
> Please try this patch and let me know if it does what you want.
>
[snip]
This patch works fine on my Vista installation. The .gitk file is now
hidden.
An alternative that was discussed was to move it rather than hide it so
that it ends up in the Application Data folder along with settings for
other applications. The following patch does this but hits rather more
lines of code and ends up needing to check the original location as well.
diff --git a/gitk b/gitk
index a7294a1..5ec6e7b 100755
--- a/gitk
+++ b/gitk
@@ -2509,12 +2509,13 @@ proc savestuff {w} {
global viewname viewfiles viewargs viewargscmd viewperm nextviewnum
global cmitmode wrapcomment datetimeformat limitdiffs
global colors bgcolor fgcolor diffcolors diffcontext selectbgcolor
- global autoselect extdifftool perfile_attrs markbgcolor
+ global autoselect extdifftool perfile_attrs markbgcolor rcfile
if {$stuffsaved} return
if {![winfo viewable .]} return
- catch {
- set f [open "~/.gitk-new" w]
+ set tmpfile "${rcfile}-new"
+ if {[catch {
+ set f [open $tmpfile {CREAT WRONLY}]
puts $f [list set mainfont $mainfont]
puts $f [list set textfont $textfont]
puts $f [list set uifont $uifont]
@@ -2555,7 +2556,10 @@ proc savestuff {w} {
}
puts $f "}"
close $f
- file rename -force "~/.gitk-new" "~/.gitk"
+ file rename -force $tmpfile $rcfile
+ } err]} {
+ tk_messageBox -icon error -message $err \
+ -title "Failed to save preferences"
}
set stuffsaved 1
}
@@ -10790,7 +10794,13 @@ namespace import ::msgcat::mc
## And eventually load the actual message catalog
::msgcat::mcload $gitk_msgsdir
-catch {source ~/.gitk}
+set rcfile ~/.gitk
+if {$::tcl_platform(platform) eq "windows"} {
+ # Load old settings file if present
+ if {[file exists ~/.gitk]} {catch {source ~/.gitk}}
+ set rcfile [file join $env(APPDATA) gitk.settings]
+}
+catch {source $rcfile}
font create optionfont -family sans-serif -size -12
next prev parent reply other threads:[~2009-03-24 0:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-17 13:45 .gitk should created hidden in windows Steve Wagner
2009-03-23 10:37 ` Paul Mackerras
2009-03-23 12:18 ` Steve Wagner
2009-03-24 0:04 ` Pat Thoyts [this message]
2009-03-24 1:39 ` Johannes Schindelin
2009-04-17 10:49 ` Paul Mackerras
2009-03-24 2:08 ` John Tapsell
2009-03-24 2:14 ` Johannes Schindelin
-- strict thread matches above, loose matches on Subject: below --
2009-03-17 15:56 John Dlugosz
2009-03-17 16:06 ` Steve Wagner
2009-03-17 16:11 ` John Dlugosz
2009-03-17 16:35 ` Steve Wagner
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=49C82377.40101@users.sourceforge.net \
--to=patthoyts@users.sourceforge.net \
--cc=git@vger.kernel.org \
--cc=lists@lanwin.de \
--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).