{"thread":{"id":"18346","subject":".gitk should created hidden in windows","startedAt":"2009-03-17T13:45:30Z","lastAt":"2009-04-17T10:49:27Z","messageCount":8,"participants":["Steve Wagner","Paul Mackerras","Pat Thoyts","Johannes Schindelin","John Tapsell"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"108227","messageId":"49BFA97A.1030203@lanwin.de","threadId":"18346","inReplyTo":null,"subject":".gitk should created hidden in windows","fromName":"Steve Wagner","fromEmail":"lists@lanwin.de","sentAt":"2009-03-17T13:45:30Z","receivedAt":"2009-03-17T13:45:30Z","isPatch":false,"sender":{"key":"lists@lanwin.de","avatar":"https://gravatar.com/avatar/4d3054dadf5236f339037d2dcd0f8ab9ab05cce11d61b92ac5b5f89547dcb5a7?d=mp&s=160"},"body":"Hi Paul, i write this to the git mailing list because of the advice from\n Johannes Schindelin in the MSysGit Issue:\n\nhttp://code.google.com/p/msysgit/issues/detail?id=143\n\nThe problem is that windows dose not hides files beginning with a dot as\nit is in unix. So the .gitk file is created as visible in the windows\nuser profile. Problematic too is that i can no set the hidden attribute\nto this file, because it is recreated every time i start gitk, so the\nhidden attribute gets lost.\n\nCan you control this and create the file with the hidden attribute on\nwindows?\n\nSteve\n"},{"id":"109044","messageId":"18887.26239.115820.450313@cargo.ozlabs.ibm.com","threadId":"18346","inReplyTo":"49BFA97A.1030203@lanwin.de","subject":"Re: .gitk should created hidden in windows","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2009-03-23T10:37:51Z","receivedAt":"2009-03-23T10:37:51Z","isPatch":false,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"Steve Wagner writes:\n\n> The problem is that windows dose not hides files beginning with a dot as\n> it is in unix. So the .gitk file is created as visible in the windows\n> user profile. Problematic too is that i can no set the hidden attribute\n> to this file, because it is recreated every time i start gitk, so the\n> hidden attribute gets lost.\n> \n> Can you control this and create the file with the hidden attribute on\n> windows?\n\nPlease try this patch and let me know if it does what you want.\n\nPaul.\n\ndiff --git a/gitk b/gitk\nindex d7de27e..54f3f2b 100755\n--- a/gitk\n+++ b/gitk\n@@ -2487,6 +2487,9 @@ proc savestuff {w} {\n     if {![winfo viewable .]} return\n     catch {\n \tset f [open \"~/.gitk-new\" w]\n+\tif {$::tcl_platform(platform) eq {windows}} {\n+\t    file attributes \"~/.gitk-new\" -hidden true\n+\t}\n \tputs $f [list set mainfont $mainfont]\n \tputs $f [list set textfont $textfont]\n \tputs $f [list set uifont $uifont]\n"},{"id":"109050","messageId":"49C77E05.80603@lanwin.de","threadId":"18346","inReplyTo":"18887.26239.115820.450313@cargo.ozlabs.ibm.com","subject":"Re: .gitk should created hidden in windows","fromName":"Steve Wagner","fromEmail":"lists@lanwin.de","sentAt":"2009-03-23T12:18:13Z","receivedAt":"2009-03-23T12:18:13Z","isPatch":false,"sender":{"key":"lists@lanwin.de","avatar":"https://gravatar.com/avatar/4d3054dadf5236f339037d2dcd0f8ab9ab05cce11d61b92ac5b5f89547dcb5a7?d=mp&s=160"},"body":"Seems to work here. Thanks for fixing it!\n\nSteve\n\nPaul Mackerras schrieb:\n> Steve Wagner writes:\n> \n>> The problem is that windows dose not hides files beginning with a dot as\n>> it is in unix. So the .gitk file is created as visible in the windows\n>> user profile. Problematic too is that i can no set the hidden attribute\n>> to this file, because it is recreated every time i start gitk, so the\n>> hidden attribute gets lost.\n>>\n>> Can you control this and create the file with the hidden attribute on\n>> windows?\n> \n> Please try this patch and let me know if it does what you want.\n> \n> Paul.\n> \n> diff --git a/gitk b/gitk\n> index d7de27e..54f3f2b 100755\n> --- a/gitk\n> +++ b/gitk\n> @@ -2487,6 +2487,9 @@ proc savestuff {w} {\n>      if {![winfo viewable .]} return\n>      catch {\n>  \tset f [open \"~/.gitk-new\" w]\n> +\tif {$::tcl_platform(platform) eq {windows}} {\n> +\t    file attributes \"~/.gitk-new\" -hidden true\n> +\t}\n>  \tputs $f [list set mainfont $mainfont]\n>  \tputs $f [list set textfont $textfont]\n>  \tputs $f [list set uifont $uifont]\n> \n"},{"id":"109122","messageId":"49C82377.40101@users.sourceforge.net","threadId":"18346","inReplyTo":"18887.26239.115820.450313@cargo.ozlabs.ibm.com","subject":"Re: .gitk should created hidden in windows","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2009-03-24T00:04:07Z","receivedAt":"2009-03-24T00:04:07Z","isPatch":false,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"Paul Mackerras wrote:\n> Please try this patch and let me know if it does what you want.\n> \n[snip]\n\nThis patch works fine on my Vista installation. The .gitk file is now\nhidden.\n\nAn alternative that was discussed was to move it rather than hide it so\nthat it ends up in the Application Data folder along with settings for\nother applications. The following patch does this but hits rather more\nlines of code and ends up needing to check the original location as well.\n\ndiff --git a/gitk b/gitk\nindex a7294a1..5ec6e7b 100755\n--- a/gitk\n+++ b/gitk\n@@ -2509,12 +2509,13 @@ proc savestuff {w} {\n     global viewname viewfiles viewargs viewargscmd viewperm nextviewnum\n     global cmitmode wrapcomment datetimeformat limitdiffs\n     global colors bgcolor fgcolor diffcolors diffcontext selectbgcolor\n-    global autoselect extdifftool perfile_attrs markbgcolor\n+    global autoselect extdifftool perfile_attrs markbgcolor rcfile\n\n     if {$stuffsaved} return\n     if {![winfo viewable .]} return\n-    catch {\n-\tset f [open \"~/.gitk-new\" w]\n+    set tmpfile \"${rcfile}-new\"\n+    if {[catch {\n+\tset f [open $tmpfile {CREAT WRONLY}]\n \tputs $f [list set mainfont $mainfont]\n \tputs $f [list set textfont $textfont]\n \tputs $f [list set uifont $uifont]\n@@ -2555,7 +2556,10 @@ proc savestuff {w} {\n \t}\n \tputs $f \"}\"\n \tclose $f\n-\tfile rename -force \"~/.gitk-new\" \"~/.gitk\"\n+\tfile rename -force $tmpfile $rcfile\n+    } err]} {\n+        tk_messageBox -icon error -message $err \\\n+            -title \"Failed to save preferences\"\n     }\n     set stuffsaved 1\n }\n@@ -10790,7 +10794,13 @@ namespace import ::msgcat::mc\n ## And eventually load the actual message catalog\n ::msgcat::mcload $gitk_msgsdir\n\n-catch {source ~/.gitk}\n+set rcfile ~/.gitk\n+if {$::tcl_platform(platform) eq \"windows\"} {\n+    # Load old settings file if present\n+    if {[file exists ~/.gitk]} {catch {source ~/.gitk}}\n+    set rcfile [file join $env(APPDATA) gitk.settings]\n+}\n+catch {source $rcfile}\n\n font create optionfont -family sans-serif -size -12\n"},{"id":"109143","messageId":"alpine.DEB.1.00.0903240238440.10279@pacific.mpi-cbg.de","threadId":"18346","inReplyTo":"49C82377.40101@users.sourceforge.net","subject":"Re: .gitk should created hidden in windows","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-03-24T01:39:40Z","receivedAt":"2009-03-24T01:39:40Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 24 Mar 2009, Pat Thoyts wrote:\n\n> Paul Mackerras wrote:\n> > Please try this patch and let me know if it does what you want.\n> > \n> [snip]\n> \n> This patch works fine on my Vista installation. The .gitk file is now \n> hidden.\n> \n> An alternative that was discussed was to move it rather than hide it so \n> that it ends up in the Application Data folder along with settings for \n> other applications. The following patch does this but hits rather more \n> lines of code and ends up needing to check the original location as \n> well.\n\nWhile I see your point, keep in mind that this patch would make Git for \nWindows even more incompatible with Git \"In The Rest Of The World\"...\n\nCiao,\nDscho\n"},{"id":"109147","messageId":"43d8ce650903231908y54bb1c34t45a78f218b2ccd9f@mail.gmail.com","threadId":"18346","inReplyTo":"18887.26239.115820.450313@cargo.ozlabs.ibm.com","subject":"Re: .gitk should created hidden in windows","fromName":"John Tapsell","fromEmail":"johnflux@gmail.com","sentAt":"2009-03-24T02:08:37Z","receivedAt":"2009-03-24T02:08:37Z","isPatch":false,"sender":{"key":"johnflux@gmail.com","avatar":"https://gravatar.com/avatar/25f70d4c0f96396b84a2e34bcd9bdc233462c7b4be29b5fdca8266fc53f30b0c?d=mp&s=160"},"body":"2009/3/23 Paul Mackerras <paulus@samba.org>:\n> Steve Wagner writes:\n>\n>> The problem is that windows dose not hides files beginning with a dot as\n>> it is in unix. So the .gitk file is created as visible in the windows\n>> user profile. Problematic too is that i can no set the hidden attribute\n>> to this file, because it is recreated every time i start gitk, so the\n>> hidden attribute gets lost.\n>>\n>> Can you control this and create the file with the hidden attribute on\n>> windows?\n>\n> Please try this patch and let me know if it does what you want.\n>\n> Paul.\n>\n> diff --git a/gitk b/gitk\n> index d7de27e..54f3f2b 100755\n> --- a/gitk\n> +++ b/gitk\n> @@ -2487,6 +2487,9 @@ proc savestuff {w} {\n>     if {![winfo viewable .]} return\n>     catch {\n>        set f [open \"~/.gitk-new\" w]\n> +       if {$::tcl_platform(platform) eq {windows}} {\n> +           file attributes \"~/.gitk-new\" -hidden true\n> +       }\n>        puts $f [list set mainfont $mainfont]\n>        puts $f [list set textfont $textfont]\n>        puts $f [list set uifont $uifont]\n\nHow about making all files beginning with .  hidden?  .gitignore for example\n"},{"id":"109148","messageId":"alpine.DEB.1.00.0903240314140.10279@pacific.mpi-cbg.de","threadId":"18346","inReplyTo":"43d8ce650903231908y54bb1c34t45a78f218b2ccd9f@mail.gmail.com","subject":"Re: .gitk should created hidden in windows","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-03-24T02:14:52Z","receivedAt":"2009-03-24T02:14:52Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 24 Mar 2009, John Tapsell wrote:\n\n> How about making all files beginning with .  hidden?  .gitignore for \n> example\n\nUhm.\n\nDid you miss that this patch was about gitk, not git.git?\n\nCiao,\nDscho\n"},{"id":"111479","messageId":"18920.24247.209397.732896@cargo.ozlabs.ibm.com","threadId":"18346","inReplyTo":"49C82377.40101@users.sourceforge.net","subject":"Re: .gitk should created hidden in windows","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2009-04-17T10:49:27Z","receivedAt":"2009-04-17T10:49:27Z","isPatch":false,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"Pat Thoyts writes:\n\n> An alternative that was discussed was to move it rather than hide it so\n> that it ends up in the Application Data folder along with settings for\n> other applications. The following patch does this but hits rather more\n> lines of code and ends up needing to check the original location as well.\n\nSounds OK, but wouldn't we want to ignore ~/.gitk if there is a\ngitk.settings in application data directory?\n\nPaul.\n"}]}