* .gitk should created hidden in windows
@ 2009-03-17 13:45 Steve Wagner
2009-03-23 10:37 ` Paul Mackerras
0 siblings, 1 reply; 12+ messages in thread
From: Steve Wagner @ 2009-03-17 13:45 UTC (permalink / raw)
To: Paul Mackerras; +Cc: git
Hi Paul, i write this to the git mailing list because of the advice from
Johannes Schindelin in the MSysGit Issue:
http://code.google.com/p/msysgit/issues/detail?id=143
The problem is that windows dose not hides files beginning with a dot as
it is in unix. So the .gitk file is created as visible in the windows
user profile. Problematic too is that i can no set the hidden attribute
to this file, because it is recreated every time i start gitk, so the
hidden attribute gets lost.
Can you control this and create the file with the hidden attribute on
windows?
Steve
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: .gitk should created hidden in windows
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
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Paul Mackerras @ 2009-03-23 10:37 UTC (permalink / raw)
To: Steve Wagner; +Cc: git
Steve Wagner writes:
> The problem is that windows dose not hides files beginning with a dot as
> it is in unix. So the .gitk file is created as visible in the windows
> user profile. Problematic too is that i can no set the hidden attribute
> to this file, because it is recreated every time i start gitk, so the
> hidden attribute gets lost.
>
> Can you control this and create the file with the hidden attribute on
> windows?
Please try this patch and let me know if it does what you want.
Paul.
diff --git a/gitk b/gitk
index d7de27e..54f3f2b 100755
--- a/gitk
+++ b/gitk
@@ -2487,6 +2487,9 @@ proc savestuff {w} {
if {![winfo viewable .]} return
catch {
set f [open "~/.gitk-new" w]
+ if {$::tcl_platform(platform) eq {windows}} {
+ file attributes "~/.gitk-new" -hidden true
+ }
puts $f [list set mainfont $mainfont]
puts $f [list set textfont $textfont]
puts $f [list set uifont $uifont]
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: .gitk should created hidden in windows
2009-03-23 10:37 ` Paul Mackerras
@ 2009-03-23 12:18 ` Steve Wagner
2009-03-24 0:04 ` Pat Thoyts
2009-03-24 2:08 ` John Tapsell
2 siblings, 0 replies; 12+ messages in thread
From: Steve Wagner @ 2009-03-23 12:18 UTC (permalink / raw)
To: Paul Mackerras; +Cc: git
Seems to work here. Thanks for fixing it!
Steve
Paul Mackerras schrieb:
> Steve Wagner writes:
>
>> The problem is that windows dose not hides files beginning with a dot as
>> it is in unix. So the .gitk file is created as visible in the windows
>> user profile. Problematic too is that i can no set the hidden attribute
>> to this file, because it is recreated every time i start gitk, so the
>> hidden attribute gets lost.
>>
>> Can you control this and create the file with the hidden attribute on
>> windows?
>
> Please try this patch and let me know if it does what you want.
>
> Paul.
>
> diff --git a/gitk b/gitk
> index d7de27e..54f3f2b 100755
> --- a/gitk
> +++ b/gitk
> @@ -2487,6 +2487,9 @@ proc savestuff {w} {
> if {![winfo viewable .]} return
> catch {
> set f [open "~/.gitk-new" w]
> + if {$::tcl_platform(platform) eq {windows}} {
> + file attributes "~/.gitk-new" -hidden true
> + }
> puts $f [list set mainfont $mainfont]
> puts $f [list set textfont $textfont]
> puts $f [list set uifont $uifont]
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: .gitk should created hidden in windows
2009-03-23 10:37 ` Paul Mackerras
2009-03-23 12:18 ` Steve Wagner
@ 2009-03-24 0:04 ` Pat Thoyts
2009-03-24 1:39 ` Johannes Schindelin
2009-04-17 10:49 ` Paul Mackerras
2009-03-24 2:08 ` John Tapsell
2 siblings, 2 replies; 12+ messages in thread
From: Pat Thoyts @ 2009-03-24 0:04 UTC (permalink / raw)
To: Paul Mackerras; +Cc: Steve Wagner, git
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
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: .gitk should created hidden in windows
2009-03-24 0:04 ` Pat Thoyts
@ 2009-03-24 1:39 ` Johannes Schindelin
2009-04-17 10:49 ` Paul Mackerras
1 sibling, 0 replies; 12+ messages in thread
From: Johannes Schindelin @ 2009-03-24 1:39 UTC (permalink / raw)
To: Pat Thoyts; +Cc: Paul Mackerras, Steve Wagner, git
Hi,
On Tue, 24 Mar 2009, Pat Thoyts wrote:
> 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.
While I see your point, keep in mind that this patch would make Git for
Windows even more incompatible with Git "In The Rest Of The World"...
Ciao,
Dscho
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: .gitk should created hidden in windows
2009-03-24 0:04 ` Pat Thoyts
2009-03-24 1:39 ` Johannes Schindelin
@ 2009-04-17 10:49 ` Paul Mackerras
1 sibling, 0 replies; 12+ messages in thread
From: Paul Mackerras @ 2009-04-17 10:49 UTC (permalink / raw)
To: Pat Thoyts; +Cc: Steve Wagner, git
Pat Thoyts writes:
> 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.
Sounds OK, but wouldn't we want to ignore ~/.gitk if there is a
gitk.settings in application data directory?
Paul.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: .gitk should created hidden in windows
2009-03-23 10:37 ` Paul Mackerras
2009-03-23 12:18 ` Steve Wagner
2009-03-24 0:04 ` Pat Thoyts
@ 2009-03-24 2:08 ` John Tapsell
2009-03-24 2:14 ` Johannes Schindelin
2 siblings, 1 reply; 12+ messages in thread
From: John Tapsell @ 2009-03-24 2:08 UTC (permalink / raw)
To: Paul Mackerras; +Cc: Steve Wagner, git
2009/3/23 Paul Mackerras <paulus@samba.org>:
> Steve Wagner writes:
>
>> The problem is that windows dose not hides files beginning with a dot as
>> it is in unix. So the .gitk file is created as visible in the windows
>> user profile. Problematic too is that i can no set the hidden attribute
>> to this file, because it is recreated every time i start gitk, so the
>> hidden attribute gets lost.
>>
>> Can you control this and create the file with the hidden attribute on
>> windows?
>
> Please try this patch and let me know if it does what you want.
>
> Paul.
>
> diff --git a/gitk b/gitk
> index d7de27e..54f3f2b 100755
> --- a/gitk
> +++ b/gitk
> @@ -2487,6 +2487,9 @@ proc savestuff {w} {
> if {![winfo viewable .]} return
> catch {
> set f [open "~/.gitk-new" w]
> + if {$::tcl_platform(platform) eq {windows}} {
> + file attributes "~/.gitk-new" -hidden true
> + }
> puts $f [list set mainfont $mainfont]
> puts $f [list set textfont $textfont]
> puts $f [list set uifont $uifont]
How about making all files beginning with . hidden? .gitignore for example
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: .gitk should created hidden in windows
@ 2009-03-17 15:56 John Dlugosz
2009-03-17 16:06 ` Steve Wagner
0 siblings, 1 reply; 12+ messages in thread
From: John Dlugosz @ 2009-03-17 15:56 UTC (permalink / raw)
To: git; +Cc: lists
=== Re: ===
The problem is that windows dose not hides files beginning with a dot as
it is in unix. So the .gitk file is created as visible in the windows
user profile. Problematic too is that i can no set the hidden attribute
to this file, because it is recreated every time i start gitk, so the
hidden attribute gets lost.
=== end ===
I didn't even notice that file, and I use gitk all the time. That
directory it put it in, the "top level" user directory based on profile,
is not something that is directly examined by most users. It is
probably used as roughly equivalent to the home directory under Unix,
but is not exactly---Windows has separate defined locations for
programs's settings, user documents, and desktop among others. I think
this file properly belongs in %APPDATA%, which is a hidden directory.
The stuff in that directory is not itself hidden.
That is, use the APPDATA environment variable to locate the file, rather
than the HOME environment variable.
--John
TradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.
If you received this in error, please contact the sender and delete the material from any computer.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: .gitk should created hidden in windows
2009-03-17 15:56 John Dlugosz
@ 2009-03-17 16:06 ` Steve Wagner
2009-03-17 16:11 ` John Dlugosz
0 siblings, 1 reply; 12+ messages in thread
From: Steve Wagner @ 2009-03-17 16:06 UTC (permalink / raw)
To: John Dlugosz; +Cc: git
> I didn't even notice that file, and I use gitk all the time. That
> directory it put it in, the "top level" user directory based on profile,
> is not something that is directly examined by most users.
This is true for XP and before, but in Vista, 2008 and Windows 7 the
user have directly access to the user profile directory (simply click on
the username in startmenue) and can see the .gitk file.
Steve
John Dlugosz schrieb:
> === Re: ===
> The problem is that windows dose not hides files beginning with a dot as
> it is in unix. So the .gitk file is created as visible in the windows
> user profile. Problematic too is that i can no set the hidden attribute
> to this file, because it is recreated every time i start gitk, so the
> hidden attribute gets lost.
> === end ===
>
> I didn't even notice that file, and I use gitk all the time. That
> directory it put it in, the "top level" user directory based on profile,
> is not something that is directly examined by most users. It is
> probably used as roughly equivalent to the home directory under Unix,
> but is not exactly---Windows has separate defined locations for
> programs's settings, user documents, and desktop among others. I think
> this file properly belongs in %APPDATA%, which is a hidden directory.
> The stuff in that directory is not itself hidden.
>
> That is, use the APPDATA environment variable to locate the file, rather
> than the HOME environment variable.
>
> --John
>
>
>
>
> TradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibite
d. If you received this in error, please contact the sender and delete the material from any computer.
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* RE: .gitk should created hidden in windows
2009-03-17 16:06 ` Steve Wagner
@ 2009-03-17 16:11 ` John Dlugosz
2009-03-17 16:35 ` Steve Wagner
0 siblings, 1 reply; 12+ messages in thread
From: John Dlugosz @ 2009-03-17 16:11 UTC (permalink / raw)
To: Steve Wagner; +Cc: git
> This is true for XP and before, but in Vista, 2008 and Windows 7 the
> user have directly access to the user profile directory (simply click
> on
> the username in startmenue) and can see the .gitk file.
>
> Steve
Yes, I was thinking that I was confronted by these things more in Vista
on a desktop, but can't remember exactly. A lot of the directories are
symbolic links that can't be clicked! I'm running Windows 2003 which I
think is based on the Vista core, but doesn't have the flashy UI candy,
for servers.
But, you would not see more clutter if it was in the place where your
APPDATA environment variable points, right?
--John
TradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.
If you received this in error, please contact the sender and delete the material from any computer.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: .gitk should created hidden in windows
2009-03-17 16:11 ` John Dlugosz
@ 2009-03-17 16:35 ` Steve Wagner
0 siblings, 0 replies; 12+ messages in thread
From: Steve Wagner @ 2009-03-17 16:35 UTC (permalink / raw)
To: John Dlugosz; +Cc: git
John Dlugosz schrieb:
> Yes, I was thinking that I was confronted by these things more in Vista
> on a desktop, but can't remember exactly. A lot of the directories are
> symbolic links that can't be clicked! I'm running Windows 2003 which I
> think is based on the Vista core, but doesn't have the flashy UI candy,
> for servers.
As far as is know, 2003 is based on xp and the this large amount of
symbolic links are only there to dont break bad develop applications
which are not using variables like APPDATA.
> But, you would not see more clutter if it was in the place where your
> APPDATA environment variable points, right?
Yes this is the better approach on windows, but since it is only one
file, it would be ok to leave it there and make it hidden.
Steve
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2009-04-17 10:54 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
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).