All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] git-gui: fix unintended line break in message string
@ 2011-10-14 19:25 Bert Wesarg
  2011-10-14 19:25 ` [PATCH 2/3] git-gui: use "untracked" for files which are not known to git Bert Wesarg
  0 siblings, 1 reply; 9+ messages in thread
From: Bert Wesarg @ 2011-10-14 19:25 UTC (permalink / raw)
  To: Pat Thoyts; +Cc: Heiko Voigt, git, Bert Wesarg

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---

Probably because of a white-space damaged patch.
---
 lib/index.tcl |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/lib/index.tcl b/lib/index.tcl
index e38b647..3a9c8b7 100644
--- a/lib/index.tcl
+++ b/lib/index.tcl
@@ -367,8 +367,7 @@ proc do_add_all {} {
 		}
 	}
 	if {[llength $unknown_paths]} {
-		set reply [ask_popup [mc "There are unknown files do you also want
-to stage those?"]]
+		set reply [ask_popup [mc "There are unknown files do you also want to stage those?"]]
 		if {$reply} {
 			set paths [concat $paths $unknown_paths]
 		}
-- 
1.7.6.789.gb4599

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/3] git-gui: use "untracked" for files which are not known to git
  2011-10-14 19:25 [PATCH 1/3] git-gui: fix unintended line break in message string Bert Wesarg
@ 2011-10-14 19:25 ` Bert Wesarg
  2011-10-14 19:25   ` [PATCH 3/3] git-gui: new config to control staging of untracked files Bert Wesarg
  0 siblings, 1 reply; 9+ messages in thread
From: Bert Wesarg @ 2011-10-14 19:25 UTC (permalink / raw)
  To: Pat Thoyts; +Cc: Heiko Voigt, git, Bert Wesarg

"untracked" is the right phrase for files new to git. For example
git-status uses this phrase. Also make the question shorter.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
 lib/index.tcl |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/index.tcl b/lib/index.tcl
index 3a9c8b7..014acf9 100644
--- a/lib/index.tcl
+++ b/lib/index.tcl
@@ -356,20 +356,20 @@ proc do_add_all {} {
 	global file_states
 
 	set paths [list]
-	set unknown_paths [list]
+	set untracked_paths [list]
 	foreach path [array names file_states] {
 		switch -glob -- [lindex $file_states($path) 0] {
 		U? {continue}
 		?M -
 		?T -
 		?D {lappend paths $path}
-		?O {lappend unknown_paths $path}
+		?O {lappend untracked_paths $path}
 		}
 	}
-	if {[llength $unknown_paths]} {
-		set reply [ask_popup [mc "There are unknown files do you also want to stage those?"]]
+	if {[llength $untracked_paths]} {
+		set reply [ask_popup [mc "Stage also untracked files?"]]
 		if {$reply} {
-			set paths [concat $paths $unknown_paths]
+			set paths [concat $paths $untracked_paths]
 		}
 	}
 	add_helper {Adding all changed files} $paths
-- 
1.7.6.789.gb4599

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/3] git-gui: new config to control staging of untracked files
  2011-10-14 19:25 ` [PATCH 2/3] git-gui: use "untracked" for files which are not known to git Bert Wesarg
@ 2011-10-14 19:25   ` Bert Wesarg
  2011-10-17 18:34     ` Heiko Voigt
  0 siblings, 1 reply; 9+ messages in thread
From: Bert Wesarg @ 2011-10-14 19:25 UTC (permalink / raw)
  To: Pat Thoyts; +Cc: Heiko Voigt, git, Bert Wesarg

The default is the current "ask".

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
 git-gui.sh     |    1 +
 lib/index.tcl  |   14 +++++++++++++-
 lib/option.tcl |   18 ++++++++++++++++++
 3 files changed, 32 insertions(+), 1 deletions(-)

diff --git a/git-gui.sh b/git-gui.sh
index f897160..77deff7 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -859,6 +859,7 @@ set font_descs {
 	{fontui   font_ui   {mc "Main Font"}}
 	{fontdiff font_diff {mc "Diff/Console Font"}}
 }
+set default_config(gui.stageuntracked) ask
 
 ######################################################################
 ##
diff --git a/lib/index.tcl b/lib/index.tcl
index 014acf9..45094c2 100644
--- a/lib/index.tcl
+++ b/lib/index.tcl
@@ -367,7 +367,19 @@ proc do_add_all {} {
 		}
 	}
 	if {[llength $untracked_paths]} {
-		set reply [ask_popup [mc "Stage also untracked files?"]]
+		set reply 0
+		switch -- [get_config gui.stageuntracked] {
+		no {
+			set reply 0
+		}
+		yes {
+			set reply 1
+		}
+		ask -
+		default {
+			set reply [ask_popup [mc "Stage also untracked files?"]]
+		}
+		}
 		if {$reply} {
 			set paths [concat $paths $untracked_paths]
 		}
diff --git a/lib/option.tcl b/lib/option.tcl
index 3807c8d..719103a 100644
--- a/lib/option.tcl
+++ b/lib/option.tcl
@@ -156,6 +156,7 @@ proc do_options {} {
 		{i-0..99 gui.commitmsgwidth {mc "Commit Message Text Width"}}
 		{t gui.newbranchtemplate {mc "New Branch Name Template"}}
 		{c gui.encoding {mc "Default File Contents Encoding"}}
+		{s gui.stageuntracked {mc "Staging of untracked files"} {list "yes" "no" "ask"}}
 		} {
 		set type [lindex $option 0]
 		set name [lindex $option 1]
@@ -208,6 +209,23 @@ proc do_options {} {
 				}
 				pack $w.$f.$optid -side top -anchor w -fill x
 			}
+			s {
+				set opts [eval [lindex $option 3]]
+				${NS}::frame $w.$f.$optid
+				${NS}::label $w.$f.$optid.l -text "$text:"
+				if {$use_ttk} {
+					ttk::combobox $w.$f.$optid.v \
+						-textvariable ${f}_config_new($name) \
+						-values $opts -state readonly
+				} else {
+					eval tk_optionMenu $w.$f.$optid.v \
+						${f}_config_new($name) \
+						$opts
+				}
+				pack $w.$f.$optid.l -side left -anchor w -fill x
+				pack $w.$f.$optid.v -side right -anchor e -padx 5
+				pack $w.$f.$optid -side top -anchor w -fill x
+			}
 			}
 		}
 	}
-- 
1.7.6.789.gb4599

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] git-gui: new config to control staging of untracked files
  2011-10-14 19:25   ` [PATCH 3/3] git-gui: new config to control staging of untracked files Bert Wesarg
@ 2011-10-17 18:34     ` Heiko Voigt
  2011-10-17 18:47       ` Bert Wesarg
  0 siblings, 1 reply; 9+ messages in thread
From: Heiko Voigt @ 2011-10-17 18:34 UTC (permalink / raw)
  To: Bert Wesarg; +Cc: Pat Thoyts, git

Hi,

what the series tries to achieve looks good to me. Just one comment.

On Fri, Oct 14, 2011 at 09:25:21PM +0200, Bert Wesarg wrote:
[...]
> diff --git a/lib/index.tcl b/lib/index.tcl
> index 014acf9..45094c2 100644
> --- a/lib/index.tcl
> +++ b/lib/index.tcl
> @@ -367,7 +367,19 @@ proc do_add_all {} {
>  		}
>  	}
>  	if {[llength $untracked_paths]} {
> -		set reply [ask_popup [mc "Stage also untracked files?"]]
> +		set reply 0
> +		switch -- [get_config gui.stageuntracked] {
> +		no {
> +			set reply 0
> +		}
[...]

Here I am wondering whether we have a similar mechanism in git gui like
in core git that makes yes,true,1 equivalents (and similar with other
values) ? If we don't I think the series is fine as it is otherwise it
probably makes sense to use that mechanism.

Cheers Heiko

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] git-gui: new config to control staging of untracked files
  2011-10-17 18:34     ` Heiko Voigt
@ 2011-10-17 18:47       ` Bert Wesarg
  2011-10-17 19:27         ` Heiko Voigt
  0 siblings, 1 reply; 9+ messages in thread
From: Bert Wesarg @ 2011-10-17 18:47 UTC (permalink / raw)
  To: Heiko Voigt; +Cc: Pat Thoyts, git

On Mon, Oct 17, 2011 at 20:34, Heiko Voigt <hvoigt@hvoigt.net> wrote:
> Hi,
>
> what the series tries to achieve looks good to me. Just one comment.

Thanks.

>
> On Fri, Oct 14, 2011 at 09:25:21PM +0200, Bert Wesarg wrote:
> [...]
>> diff --git a/lib/index.tcl b/lib/index.tcl
>> index 014acf9..45094c2 100644
>> --- a/lib/index.tcl
>> +++ b/lib/index.tcl
>> @@ -367,7 +367,19 @@ proc do_add_all {} {
>>               }
>>       }
>>       if {[llength $untracked_paths]} {
>> -             set reply [ask_popup [mc "Stage also untracked files?"]]
>> +             set reply 0
>> +             switch -- [get_config gui.stageuntracked] {
>> +             no {
>> +                     set reply 0
>> +             }
> [...]
>
> Here I am wondering whether we have a similar mechanism in git gui like
> in core git that makes yes,true,1 equivalents (and similar with other
> values) ?

But it is not only yes,true,1 or no,false,0 its a tristate with the
third state 'ask'. For booleans, there is such functionality in git
gui. See is_config_true and is_config_false. Reusing these for this
tristate wouldn't work. The current check here is indeed very strict
and should be loosen by at least ignoring the case, surrounding
spaces, and allow also true/false. But also note, that this variable
can be set via the Options menu, so you can't mistype it.

Bert

> If we don't I think the series is fine as it is otherwise it
> probably makes sense to use that mechanism.
>
> Cheers Heiko
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Re: [PATCH 3/3] git-gui: new config to control staging of untracked files
  2011-10-17 18:47       ` Bert Wesarg
@ 2011-10-17 19:27         ` Heiko Voigt
  2011-10-17 22:51           ` Pat Thoyts
  0 siblings, 1 reply; 9+ messages in thread
From: Heiko Voigt @ 2011-10-17 19:27 UTC (permalink / raw)
  To: Bert Wesarg; +Cc: Pat Thoyts, git

Hi,

On Mon, Oct 17, 2011 at 08:47:50PM +0200, Bert Wesarg wrote:
> On Mon, Oct 17, 2011 at 20:34, Heiko Voigt <hvoigt@hvoigt.net> wrote:
> > Here I am wondering whether we have a similar mechanism in git gui like
> > in core git that makes yes,true,1 equivalents (and similar with other
> > values) ?
> 
> But it is not only yes,true,1 or no,false,0 its a tristate with the
> third state 'ask'. For booleans, there is such functionality in git
> gui. See is_config_true and is_config_false. Reusing these for this
> tristate wouldn't work. The current check here is indeed very strict
> and should be loosen by at least ignoring the case, surrounding
> spaces, and allow also true/false. But also note, that this variable
> can be set via the Options menu, so you can't mistype it.

Well if using git config you can ;-). I just wanted to ask whether we
may already have machinery which supports such tristate.
If we do not I think the current "strict" configuration is fine. In most
cases the user will use the gui itself to configure such behavior so
thats no big deal.
If someone needs that it can be added later on.

Thanks, Heiko

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] git-gui: new config to control staging of untracked files
  2011-10-17 19:27         ` Heiko Voigt
@ 2011-10-17 22:51           ` Pat Thoyts
  2011-10-18  6:34             ` Bert Wesarg
  0 siblings, 1 reply; 9+ messages in thread
From: Pat Thoyts @ 2011-10-17 22:51 UTC (permalink / raw)
  To: Heiko Voigt; +Cc: Bert Wesarg, git

Heiko Voigt <hvoigt@hvoigt.net> writes:

>Hi,
>
>On Mon, Oct 17, 2011 at 08:47:50PM +0200, Bert Wesarg wrote:
>> On Mon, Oct 17, 2011 at 20:34, Heiko Voigt <hvoigt@hvoigt.net> wrote:
>> > Here I am wondering whether we have a similar mechanism in git gui like
>> > in core git that makes yes,true,1 equivalents (and similar with other
>> > values) ?
>> 
>> But it is not only yes,true,1 or no,false,0 its a tristate with the
>> third state 'ask'. For booleans, there is such functionality in git
>> gui. See is_config_true and is_config_false. Reusing these for this
>> tristate wouldn't work. The current check here is indeed very strict
>> and should be loosen by at least ignoring the case, surrounding
>> spaces, and allow also true/false. But also note, that this variable
>> can be set via the Options menu, so you can't mistype it.
>
>Well if using git config you can ;-). I just wanted to ask whether we
>may already have machinery which supports such tristate.
>If we do not I think the current "strict" configuration is fine. In most
>cases the user will use the gui itself to configure such behavior so
>thats no big deal.
>If someone needs that it can be added later on.
>
>Thanks, Heiko
>

This set of 3 patches looks fine. I was a bit dubious of the new
phrasing for the ask condition but it is growing on me. I wonder it it
might be worth including the number of untracked files to be staged too
eg: "Stage 15 untracked files?"

   set reply [ask_popup [mc "Stage %d untracked files?" \
                             [llength $untracked_paths]]]

Loosening the check we can do using
  switch -glob -- [get_config gui.stageuntracked] {
    [Nn]* { set reply 0}
    [Yy]* { set reply 1}
    default { ... }
  }

-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] git-gui: new config to control staging of untracked files
  2011-10-17 22:51           ` Pat Thoyts
@ 2011-10-18  6:34             ` Bert Wesarg
  2011-10-18  8:24               ` Pat Thoyts
  0 siblings, 1 reply; 9+ messages in thread
From: Bert Wesarg @ 2011-10-18  6:34 UTC (permalink / raw)
  To: Pat Thoyts; +Cc: Heiko Voigt, git

On Tue, Oct 18, 2011 at 00:51, Pat Thoyts
<patthoyts@users.sourceforge.net> wrote:
> Heiko Voigt <hvoigt@hvoigt.net> writes:
>
>>Hi,
>>
>>On Mon, Oct 17, 2011 at 08:47:50PM +0200, Bert Wesarg wrote:
>>> On Mon, Oct 17, 2011 at 20:34, Heiko Voigt <hvoigt@hvoigt.net> wrote:
>>> > Here I am wondering whether we have a similar mechanism in git gui like
>>> > in core git that makes yes,true,1 equivalents (and similar with other
>>> > values) ?
>>>
>>> But it is not only yes,true,1 or no,false,0 its a tristate with the
>>> third state 'ask'. For booleans, there is such functionality in git
>>> gui. See is_config_true and is_config_false. Reusing these for this
>>> tristate wouldn't work. The current check here is indeed very strict
>>> and should be loosen by at least ignoring the case, surrounding
>>> spaces, and allow also true/false. But also note, that this variable
>>> can be set via the Options menu, so you can't mistype it.
>>
>>Well if using git config you can ;-). I just wanted to ask whether we
>>may already have machinery which supports such tristate.
>>If we do not I think the current "strict" configuration is fine. In most
>>cases the user will use the gui itself to configure such behavior so
>>thats no big deal.
>>If someone needs that it can be added later on.
>>
>>Thanks, Heiko
>>
>
> This set of 3 patches looks fine. I was a bit dubious of the new
> phrasing for the ask condition but it is growing on me. I wonder it it
> might be worth including the number of untracked files to be staged too
> eg: "Stage 15 untracked files?"
>
>   set reply [ask_popup [mc "Stage %d untracked files?" \
>                             [llength $untracked_paths]]]

I thought about to list the untracked files in the dialog, but
couldn't find a good template dialog for this. But the number is
definitely worth I think.

>
> Loosening the check we can do using
>  switch -glob -- [get_config gui.stageuntracked] {
>    [Nn]* { set reply 0}
>    [Yy]* { set reply 1}
>    default { ... }
>  }

I think this is too loose ;-)

Bert

>
> --
> Pat Thoyts                            http://www.patthoyts.tk/
> PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] git-gui: new config to control staging of untracked files
  2011-10-18  6:34             ` Bert Wesarg
@ 2011-10-18  8:24               ` Pat Thoyts
  0 siblings, 0 replies; 9+ messages in thread
From: Pat Thoyts @ 2011-10-18  8:24 UTC (permalink / raw)
  To: Bert Wesarg; +Cc: Heiko Voigt, git

Bert Wesarg <bert.wesarg@googlemail.com> writes:

>On Tue, Oct 18, 2011 at 00:51, Pat Thoyts
><patthoyts@users.sourceforge.net> wrote:
>> Heiko Voigt <hvoigt@hvoigt.net> writes:
>>
>>>Hi,
>>>
>>>On Mon, Oct 17, 2011 at 08:47:50PM +0200, Bert Wesarg wrote:
>>>> On Mon, Oct 17, 2011 at 20:34, Heiko Voigt <hvoigt@hvoigt.net> wrote:
>>>> > Here I am wondering whether we have a similar mechanism in git gui like
>>>> > in core git that makes yes,true,1 equivalents (and similar with other
>>>> > values) ?
>>>>
>>>> But it is not only yes,true,1 or no,false,0 its a tristate with the
>>>> third state 'ask'. For booleans, there is such functionality in git
>>>> gui. See is_config_true and is_config_false. Reusing these for this
>>>> tristate wouldn't work. The current check here is indeed very strict
>>>> and should be loosen by at least ignoring the case, surrounding
>>>> spaces, and allow also true/false. But also note, that this variable
>>>> can be set via the Options menu, so you can't mistype it.
>>>
>>>Well if using git config you can ;-). I just wanted to ask whether we
>>>may already have machinery which supports such tristate.
>>>If we do not I think the current "strict" configuration is fine. In most
>>>cases the user will use the gui itself to configure such behavior so
>>>thats no big deal.
>>>If someone needs that it can be added later on.
>>>
>>>Thanks, Heiko
>>>
>>
>> This set of 3 patches looks fine. I was a bit dubious of the new
>> phrasing for the ask condition but it is growing on me. I wonder it it
>> might be worth including the number of untracked files to be staged too
>> eg: "Stage 15 untracked files?"
>>
>>   set reply [ask_popup [mc "Stage %d untracked files?" \
>>                             [llength $untracked_paths]]]
>
>I thought about to list the untracked files in the dialog, but
>couldn't find a good template dialog for this. But the number is
>definitely worth I think.
>
>>
>> Loosening the check we can do using
>>  switch -glob -- [get_config gui.stageuntracked] {
>>    [Nn]* { set reply 0}
>>    [Yy]* { set reply 1}
>>    default { ... }
>>  }
>
>I think this is too loose ;-)

Heh - I'll add the number in the query dialog and leave the config check
unchanged then.
Thanks for all your work.

-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-10-18  8:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-14 19:25 [PATCH 1/3] git-gui: fix unintended line break in message string Bert Wesarg
2011-10-14 19:25 ` [PATCH 2/3] git-gui: use "untracked" for files which are not known to git Bert Wesarg
2011-10-14 19:25   ` [PATCH 3/3] git-gui: new config to control staging of untracked files Bert Wesarg
2011-10-17 18:34     ` Heiko Voigt
2011-10-17 18:47       ` Bert Wesarg
2011-10-17 19:27         ` Heiko Voigt
2011-10-17 22:51           ` Pat Thoyts
2011-10-18  6:34             ` Bert Wesarg
2011-10-18  8:24               ` Pat Thoyts

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.