{"thread":{"id":"28681","subject":"[PATCH 1/3] git-gui: fix unintended line break in message string","startedAt":"2011-10-14T19:25:19Z","lastAt":"2011-10-18T08:24:31Z","messageCount":9,"participants":["Bert Wesarg","Heiko Voigt","Pat Thoyts"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"177670","messageId":"0f862de296a94b06495e4418bc731b5d201d5767.1318620267.git.bert.wesarg@googlemail.com","threadId":"28681","inReplyTo":null,"subject":"[PATCH 1/3] git-gui: fix unintended line break in message string","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2011-10-14T19:25:19Z","receivedAt":"2011-10-14T19:25:19Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>\n---\n\nProbably because of a white-space damaged patch.\n---\n lib/index.tcl |    3 +--\n 1 files changed, 1 insertions(+), 2 deletions(-)\n\ndiff --git a/lib/index.tcl b/lib/index.tcl\nindex e38b647..3a9c8b7 100644\n--- a/lib/index.tcl\n+++ b/lib/index.tcl\n@@ -367,8 +367,7 @@ proc do_add_all {} {\n \t\t}\n \t}\n \tif {[llength $unknown_paths]} {\n-\t\tset reply [ask_popup [mc \"There are unknown files do you also want\n-to stage those?\"]]\n+\t\tset reply [ask_popup [mc \"There are unknown files do you also want to stage those?\"]]\n \t\tif {$reply} {\n \t\t\tset paths [concat $paths $unknown_paths]\n \t\t}\n-- \n1.7.6.789.gb4599\n"},{"id":"177672","messageId":"446a8233349fd7d084fd01bf1176a4073ff17593.1318620267.git.bert.wesarg@googlemail.com","threadId":"28681","inReplyTo":"0f862de296a94b06495e4418bc731b5d201d5767.1318620267.git.bert.wesarg@googlemail.com","subject":"[PATCH 2/3] git-gui: use \"untracked\" for files which are not known to git","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2011-10-14T19:25:20Z","receivedAt":"2011-10-14T19:25:20Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"\"untracked\" is the right phrase for files new to git. For example\ngit-status uses this phrase. Also make the question shorter.\n\nSigned-off-by: Bert Wesarg <bert.wesarg@googlemail.com>\n---\n lib/index.tcl |   10 +++++-----\n 1 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/lib/index.tcl b/lib/index.tcl\nindex 3a9c8b7..014acf9 100644\n--- a/lib/index.tcl\n+++ b/lib/index.tcl\n@@ -356,20 +356,20 @@ proc do_add_all {} {\n \tglobal file_states\n \n \tset paths [list]\n-\tset unknown_paths [list]\n+\tset untracked_paths [list]\n \tforeach path [array names file_states] {\n \t\tswitch -glob -- [lindex $file_states($path) 0] {\n \t\tU? {continue}\n \t\t?M -\n \t\t?T -\n \t\t?D {lappend paths $path}\n-\t\t?O {lappend unknown_paths $path}\n+\t\t?O {lappend untracked_paths $path}\n \t\t}\n \t}\n-\tif {[llength $unknown_paths]} {\n-\t\tset reply [ask_popup [mc \"There are unknown files do you also want to stage those?\"]]\n+\tif {[llength $untracked_paths]} {\n+\t\tset reply [ask_popup [mc \"Stage also untracked files?\"]]\n \t\tif {$reply} {\n-\t\t\tset paths [concat $paths $unknown_paths]\n+\t\t\tset paths [concat $paths $untracked_paths]\n \t\t}\n \t}\n \tadd_helper {Adding all changed files} $paths\n-- \n1.7.6.789.gb4599\n"},{"id":"177671","messageId":"03727ea04f20c953e7de3f84ab1724a8360ca2c4.1318620267.git.bert.wesarg@googlemail.com","threadId":"28681","inReplyTo":"446a8233349fd7d084fd01bf1176a4073ff17593.1318620267.git.bert.wesarg@googlemail.com","subject":"[PATCH 3/3] git-gui: new config to control staging of untracked files","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2011-10-14T19:25:21Z","receivedAt":"2011-10-14T19:25:21Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"The default is the current \"ask\".\n\nSigned-off-by: Bert Wesarg <bert.wesarg@googlemail.com>\n---\n git-gui.sh     |    1 +\n lib/index.tcl  |   14 +++++++++++++-\n lib/option.tcl |   18 ++++++++++++++++++\n 3 files changed, 32 insertions(+), 1 deletions(-)\n\ndiff --git a/git-gui.sh b/git-gui.sh\nindex f897160..77deff7 100755\n--- a/git-gui.sh\n+++ b/git-gui.sh\n@@ -859,6 +859,7 @@ set font_descs {\n \t{fontui   font_ui   {mc \"Main Font\"}}\n \t{fontdiff font_diff {mc \"Diff/Console Font\"}}\n }\n+set default_config(gui.stageuntracked) ask\n \n ######################################################################\n ##\ndiff --git a/lib/index.tcl b/lib/index.tcl\nindex 014acf9..45094c2 100644\n--- a/lib/index.tcl\n+++ b/lib/index.tcl\n@@ -367,7 +367,19 @@ proc do_add_all {} {\n \t\t}\n \t}\n \tif {[llength $untracked_paths]} {\n-\t\tset reply [ask_popup [mc \"Stage also untracked files?\"]]\n+\t\tset reply 0\n+\t\tswitch -- [get_config gui.stageuntracked] {\n+\t\tno {\n+\t\t\tset reply 0\n+\t\t}\n+\t\tyes {\n+\t\t\tset reply 1\n+\t\t}\n+\t\task -\n+\t\tdefault {\n+\t\t\tset reply [ask_popup [mc \"Stage also untracked files?\"]]\n+\t\t}\n+\t\t}\n \t\tif {$reply} {\n \t\t\tset paths [concat $paths $untracked_paths]\n \t\t}\ndiff --git a/lib/option.tcl b/lib/option.tcl\nindex 3807c8d..719103a 100644\n--- a/lib/option.tcl\n+++ b/lib/option.tcl\n@@ -156,6 +156,7 @@ proc do_options {} {\n \t\t{i-0..99 gui.commitmsgwidth {mc \"Commit Message Text Width\"}}\n \t\t{t gui.newbranchtemplate {mc \"New Branch Name Template\"}}\n \t\t{c gui.encoding {mc \"Default File Contents Encoding\"}}\n+\t\t{s gui.stageuntracked {mc \"Staging of untracked files\"} {list \"yes\" \"no\" \"ask\"}}\n \t\t} {\n \t\tset type [lindex $option 0]\n \t\tset name [lindex $option 1]\n@@ -208,6 +209,23 @@ proc do_options {} {\n \t\t\t\t}\n \t\t\t\tpack $w.$f.$optid -side top -anchor w -fill x\n \t\t\t}\n+\t\t\ts {\n+\t\t\t\tset opts [eval [lindex $option 3]]\n+\t\t\t\t${NS}::frame $w.$f.$optid\n+\t\t\t\t${NS}::label $w.$f.$optid.l -text \"$text:\"\n+\t\t\t\tif {$use_ttk} {\n+\t\t\t\t\tttk::combobox $w.$f.$optid.v \\\n+\t\t\t\t\t\t-textvariable ${f}_config_new($name) \\\n+\t\t\t\t\t\t-values $opts -state readonly\n+\t\t\t\t} else {\n+\t\t\t\t\teval tk_optionMenu $w.$f.$optid.v \\\n+\t\t\t\t\t\t${f}_config_new($name) \\\n+\t\t\t\t\t\t$opts\n+\t\t\t\t}\n+\t\t\t\tpack $w.$f.$optid.l -side left -anchor w -fill x\n+\t\t\t\tpack $w.$f.$optid.v -side right -anchor e -padx 5\n+\t\t\t\tpack $w.$f.$optid -side top -anchor w -fill x\n+\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n-- \n1.7.6.789.gb4599\n"},{"id":"177869","messageId":"20111017183430.GA2540@sandbox-rc","threadId":"28681","inReplyTo":"03727ea04f20c953e7de3f84ab1724a8360ca2c4.1318620267.git.bert.wesarg@googlemail.com","subject":"Re: [PATCH 3/3] git-gui: new config to control staging of untracked files","fromName":"Heiko Voigt","fromEmail":"hvoigt@hvoigt.net","sentAt":"2011-10-17T18:34:30Z","receivedAt":"2011-10-17T18:34:30Z","isPatch":true,"sender":{"key":"hvoigt@hvoigt.net","avatar":"https://avatars.githubusercontent.com/u/184958?v=4"},"body":"Hi,\n\nwhat the series tries to achieve looks good to me. Just one comment.\n\nOn Fri, Oct 14, 2011 at 09:25:21PM +0200, Bert Wesarg wrote:\n[...]\n> diff --git a/lib/index.tcl b/lib/index.tcl\n> index 014acf9..45094c2 100644\n> --- a/lib/index.tcl\n> +++ b/lib/index.tcl\n> @@ -367,7 +367,19 @@ proc do_add_all {} {\n>  \t\t}\n>  \t}\n>  \tif {[llength $untracked_paths]} {\n> -\t\tset reply [ask_popup [mc \"Stage also untracked files?\"]]\n> +\t\tset reply 0\n> +\t\tswitch -- [get_config gui.stageuntracked] {\n> +\t\tno {\n> +\t\t\tset reply 0\n> +\t\t}\n[...]\n\nHere I am wondering whether we have a similar mechanism in git gui like\nin core git that makes yes,true,1 equivalents (and similar with other\nvalues) ? If we don't I think the series is fine as it is otherwise it\nprobably makes sense to use that mechanism.\n\nCheers Heiko\n"},{"id":"177873","messageId":"CAKPyHN3pKUSLTs8_5QMo5i+=3w7KXAHJjDOfQ1XYG92ZbQ1SeA@mail.gmail.com","threadId":"28681","inReplyTo":"20111017183430.GA2540@sandbox-rc","subject":"Re: [PATCH 3/3] git-gui: new config to control staging of untracked files","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2011-10-17T18:47:50Z","receivedAt":"2011-10-17T18:47:50Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"On Mon, Oct 17, 2011 at 20:34, Heiko Voigt <hvoigt@hvoigt.net> wrote:\n> Hi,\n>\n> what the series tries to achieve looks good to me. Just one comment.\n\nThanks.\n\n>\n> On Fri, Oct 14, 2011 at 09:25:21PM +0200, Bert Wesarg wrote:\n> [...]\n>> diff --git a/lib/index.tcl b/lib/index.tcl\n>> index 014acf9..45094c2 100644\n>> --- a/lib/index.tcl\n>> +++ b/lib/index.tcl\n>> @@ -367,7 +367,19 @@ proc do_add_all {} {\n>>               }\n>>       }\n>>       if {[llength $untracked_paths]} {\n>> -             set reply [ask_popup [mc \"Stage also untracked files?\"]]\n>> +             set reply 0\n>> +             switch -- [get_config gui.stageuntracked] {\n>> +             no {\n>> +                     set reply 0\n>> +             }\n> [...]\n>\n> Here I am wondering whether we have a similar mechanism in git gui like\n> in core git that makes yes,true,1 equivalents (and similar with other\n> values) ?\n\nBut it is not only yes,true,1 or no,false,0 its a tristate with the\nthird state 'ask'. For booleans, there is such functionality in git\ngui. See is_config_true and is_config_false. Reusing these for this\ntristate wouldn't work. The current check here is indeed very strict\nand should be loosen by at least ignoring the case, surrounding\nspaces, and allow also true/false. But also note, that this variable\ncan be set via the Options menu, so you can't mistype it.\n\nBert\n\n> If we don't I think the series is fine as it is otherwise it\n> probably makes sense to use that mechanism.\n>\n> Cheers Heiko\n>\n"},{"id":"177877","messageId":"20111017192706.GB3168@sandbox-rc","threadId":"28681","inReplyTo":"CAKPyHN3pKUSLTs8_5QMo5i+=3w7KXAHJjDOfQ1XYG92ZbQ1SeA@mail.gmail.com","subject":"Re: Re: [PATCH 3/3] git-gui: new config to control staging of untracked files","fromName":"Heiko Voigt","fromEmail":"hvoigt@hvoigt.net","sentAt":"2011-10-17T19:27:07Z","receivedAt":"2011-10-17T19:27:07Z","isPatch":true,"sender":{"key":"hvoigt@hvoigt.net","avatar":"https://avatars.githubusercontent.com/u/184958?v=4"},"body":"Hi,\n\nOn Mon, Oct 17, 2011 at 08:47:50PM +0200, Bert Wesarg wrote:\n> On Mon, Oct 17, 2011 at 20:34, Heiko Voigt <hvoigt@hvoigt.net> wrote:\n> > Here I am wondering whether we have a similar mechanism in git gui like\n> > in core git that makes yes,true,1 equivalents (and similar with other\n> > values) ?\n> \n> But it is not only yes,true,1 or no,false,0 its a tristate with the\n> third state 'ask'. For booleans, there is such functionality in git\n> gui. See is_config_true and is_config_false. Reusing these for this\n> tristate wouldn't work. The current check here is indeed very strict\n> and should be loosen by at least ignoring the case, surrounding\n> spaces, and allow also true/false. But also note, that this variable\n> can be set via the Options menu, so you can't mistype it.\n\nWell if using git config you can ;-). I just wanted to ask whether we\nmay already have machinery which supports such tristate.\nIf we do not I think the current \"strict\" configuration is fine. In most\ncases the user will use the gui itself to configure such behavior so\nthats no big deal.\nIf someone needs that it can be added later on.\n\nThanks, Heiko\n"},{"id":"177906","messageId":"87r52bgrky.fsf@fox.patthoyts.tk","threadId":"28681","inReplyTo":"20111017192706.GB3168@sandbox-rc","subject":"Re: [PATCH 3/3] git-gui: new config to control staging of untracked files","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2011-10-17T22:51:09Z","receivedAt":"2011-10-17T22:51:09Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"Heiko Voigt <hvoigt@hvoigt.net> writes:\n\n>Hi,\n>\n>On Mon, Oct 17, 2011 at 08:47:50PM +0200, Bert Wesarg wrote:\n>> On Mon, Oct 17, 2011 at 20:34, Heiko Voigt <hvoigt@hvoigt.net> wrote:\n>> > Here I am wondering whether we have a similar mechanism in git gui like\n>> > in core git that makes yes,true,1 equivalents (and similar with other\n>> > values) ?\n>> \n>> But it is not only yes,true,1 or no,false,0 its a tristate with the\n>> third state 'ask'. For booleans, there is such functionality in git\n>> gui. See is_config_true and is_config_false. Reusing these for this\n>> tristate wouldn't work. The current check here is indeed very strict\n>> and should be loosen by at least ignoring the case, surrounding\n>> spaces, and allow also true/false. But also note, that this variable\n>> can be set via the Options menu, so you can't mistype it.\n>\n>Well if using git config you can ;-). I just wanted to ask whether we\n>may already have machinery which supports such tristate.\n>If we do not I think the current \"strict\" configuration is fine. In most\n>cases the user will use the gui itself to configure such behavior so\n>thats no big deal.\n>If someone needs that it can be added later on.\n>\n>Thanks, Heiko\n>\n\nThis set of 3 patches looks fine. I was a bit dubious of the new\nphrasing for the ask condition but it is growing on me. I wonder it it\nmight be worth including the number of untracked files to be staged too\neg: \"Stage 15 untracked files?\"\n\n   set reply [ask_popup [mc \"Stage %d untracked files?\" \\\n                             [llength $untracked_paths]]]\n\nLoosening the check we can do using\n  switch -glob -- [get_config gui.stageuntracked] {\n    [Nn]* { set reply 0}\n    [Yy]* { set reply 1}\n    default { ... }\n  }\n\n-- \nPat Thoyts                            http://www.patthoyts.tk/\nPGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD\n"},{"id":"177928","messageId":"CAKPyHN2g2aVTB_Q7ZmpjfdznmUmkf=aodDmFEWgq6_KCMQe62w@mail.gmail.com","threadId":"28681","inReplyTo":"87r52bgrky.fsf@fox.patthoyts.tk","subject":"Re: [PATCH 3/3] git-gui: new config to control staging of untracked files","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2011-10-18T06:34:31Z","receivedAt":"2011-10-18T06:34:31Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"On Tue, Oct 18, 2011 at 00:51, Pat Thoyts\n<patthoyts@users.sourceforge.net> wrote:\n> Heiko Voigt <hvoigt@hvoigt.net> writes:\n>\n>>Hi,\n>>\n>>On Mon, Oct 17, 2011 at 08:47:50PM +0200, Bert Wesarg wrote:\n>>> On Mon, Oct 17, 2011 at 20:34, Heiko Voigt <hvoigt@hvoigt.net> wrote:\n>>> > Here I am wondering whether we have a similar mechanism in git gui like\n>>> > in core git that makes yes,true,1 equivalents (and similar with other\n>>> > values) ?\n>>>\n>>> But it is not only yes,true,1 or no,false,0 its a tristate with the\n>>> third state 'ask'. For booleans, there is such functionality in git\n>>> gui. See is_config_true and is_config_false. Reusing these for this\n>>> tristate wouldn't work. The current check here is indeed very strict\n>>> and should be loosen by at least ignoring the case, surrounding\n>>> spaces, and allow also true/false. But also note, that this variable\n>>> can be set via the Options menu, so you can't mistype it.\n>>\n>>Well if using git config you can ;-). I just wanted to ask whether we\n>>may already have machinery which supports such tristate.\n>>If we do not I think the current \"strict\" configuration is fine. In most\n>>cases the user will use the gui itself to configure such behavior so\n>>thats no big deal.\n>>If someone needs that it can be added later on.\n>>\n>>Thanks, Heiko\n>>\n>\n> This set of 3 patches looks fine. I was a bit dubious of the new\n> phrasing for the ask condition but it is growing on me. I wonder it it\n> might be worth including the number of untracked files to be staged too\n> eg: \"Stage 15 untracked files?\"\n>\n>   set reply [ask_popup [mc \"Stage %d untracked files?\" \\\n>                             [llength $untracked_paths]]]\n\nI thought about to list the untracked files in the dialog, but\ncouldn't find a good template dialog for this. But the number is\ndefinitely worth I think.\n\n>\n> Loosening the check we can do using\n>  switch -glob -- [get_config gui.stageuntracked] {\n>    [Nn]* { set reply 0}\n>    [Yy]* { set reply 1}\n>    default { ... }\n>  }\n\nI think this is too loose ;-)\n\nBert\n\n>\n> --\n> Pat Thoyts                            http://www.patthoyts.tk/\n> PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD\n>\n"},{"id":"177939","messageId":"87ipnmn1vk.fsf@fox.patthoyts.tk","threadId":"28681","inReplyTo":"CAKPyHN2g2aVTB_Q7ZmpjfdznmUmkf=aodDmFEWgq6_KCMQe62w@mail.gmail.com","subject":"Re: [PATCH 3/3] git-gui: new config to control staging of untracked files","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2011-10-18T08:24:31Z","receivedAt":"2011-10-18T08:24:31Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"Bert Wesarg <bert.wesarg@googlemail.com> writes:\n\n>On Tue, Oct 18, 2011 at 00:51, Pat Thoyts\n><patthoyts@users.sourceforge.net> wrote:\n>> Heiko Voigt <hvoigt@hvoigt.net> writes:\n>>\n>>>Hi,\n>>>\n>>>On Mon, Oct 17, 2011 at 08:47:50PM +0200, Bert Wesarg wrote:\n>>>> On Mon, Oct 17, 2011 at 20:34, Heiko Voigt <hvoigt@hvoigt.net> wrote:\n>>>> > Here I am wondering whether we have a similar mechanism in git gui like\n>>>> > in core git that makes yes,true,1 equivalents (and similar with other\n>>>> > values) ?\n>>>>\n>>>> But it is not only yes,true,1 or no,false,0 its a tristate with the\n>>>> third state 'ask'. For booleans, there is such functionality in git\n>>>> gui. See is_config_true and is_config_false. Reusing these for this\n>>>> tristate wouldn't work. The current check here is indeed very strict\n>>>> and should be loosen by at least ignoring the case, surrounding\n>>>> spaces, and allow also true/false. But also note, that this variable\n>>>> can be set via the Options menu, so you can't mistype it.\n>>>\n>>>Well if using git config you can ;-). I just wanted to ask whether we\n>>>may already have machinery which supports such tristate.\n>>>If we do not I think the current \"strict\" configuration is fine. In most\n>>>cases the user will use the gui itself to configure such behavior so\n>>>thats no big deal.\n>>>If someone needs that it can be added later on.\n>>>\n>>>Thanks, Heiko\n>>>\n>>\n>> This set of 3 patches looks fine. I was a bit dubious of the new\n>> phrasing for the ask condition but it is growing on me. I wonder it it\n>> might be worth including the number of untracked files to be staged too\n>> eg: \"Stage 15 untracked files?\"\n>>\n>>   set reply [ask_popup [mc \"Stage %d untracked files?\" \\\n>>                             [llength $untracked_paths]]]\n>\n>I thought about to list the untracked files in the dialog, but\n>couldn't find a good template dialog for this. But the number is\n>definitely worth I think.\n>\n>>\n>> Loosening the check we can do using\n>>  switch -glob -- [get_config gui.stageuntracked] {\n>>    [Nn]* { set reply 0}\n>>    [Yy]* { set reply 1}\n>>    default { ... }\n>>  }\n>\n>I think this is too loose ;-)\n\nHeh - I'll add the number in the query dialog and leave the config check\nunchanged then.\nThanks for all your work.\n\n-- \nPat Thoyts                            http://www.patthoyts.tk/\nPGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD\n"}]}