diff mbox series

[2/2] git-gui: Auto-rescan on activate

Message ID 20201101170505.71246-3-stefan@haller-berlin.de (mailing list archive)
State Superseded
Headers show
Series git-gui: Auto-rescan on activate | expand

Commit Message

Stefan Haller Nov. 1, 2020, 5:05 p.m. UTC
Do an automatic rescan whenever the git-gui window receives focus. Most other
GUI tools do this, and it's very convenient; no more pressing F5 manually.

People who don't like this behavior can turn it off using
"git config gui.autorescan false".

Signed-off-by: Stefan Haller <stefan@haller-berlin.de>
---
 git-gui.sh | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Pratyush Yadav Nov. 2, 2020, 3:48 p.m. UTC | #1
Hi Stefan,

On 01/11/20 06:05PM, Stefan Haller wrote:
> Do an automatic rescan whenever the git-gui window receives focus. Most other
> GUI tools do this, and it's very convenient; no more pressing F5 manually.
> 
> People who don't like this behavior can turn it off using
> "git config gui.autorescan false".
> 
> Signed-off-by: Stefan Haller <stefan@haller-berlin.de>
> ---
>  git-gui.sh | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/git-gui.sh b/git-gui.sh
> index 8864c14..4a4ac19 100755
> --- a/git-gui.sh
> +++ b/git-gui.sh
> @@ -906,6 +906,7 @@ set font_descs {
>  }
>  set default_config(gui.stageuntracked) ask
>  set default_config(gui.displayuntracked) true
> +set default_config(gui.autorescan) true

Default to false. See my reply to the cover letter for more info.

It would also be a good idea to include an option for this in the 
options dialog. Check do_options in lib/options.tcl for examples.

>  
>  ######################################################################
>  ##
> @@ -4020,6 +4021,10 @@ bind .   <Alt-Key-2> {focus_widget $::ui_index}
>  bind .   <Alt-Key-3> {focus $::ui_diff}
>  bind .   <Alt-Key-4> {focus $::ui_comm}
>  
> +if {[is_config_true gui.autorescan]} {
> +	bind .   <FocusIn>  schedule_rescan
> +}
> +

Ok.

>  set file_lists_last_clicked($ui_index) {}
>  set file_lists_last_clicked($ui_workdir) {}
>  
> -- 
> 2.29.2
>
Stefan Haller Nov. 2, 2020, 7:31 p.m. UTC | #2
On 02.11.20 16:48, Pratyush Yadav wrote:
> Hi Stefan,
> 
> On 01/11/20 06:05PM, Stefan Haller wrote:
>> Do an automatic rescan whenever the git-gui window receives focus. Most other
>> GUI tools do this, and it's very convenient; no more pressing F5 manually.
>>
>> People who don't like this behavior can turn it off using
>> "git config gui.autorescan false".
>>
>> Signed-off-by: Stefan Haller <stefan@haller-berlin.de>
>> ---
>>  git-gui.sh | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/git-gui.sh b/git-gui.sh
>> index 8864c14..4a4ac19 100755
>> --- a/git-gui.sh
>> +++ b/git-gui.sh
>> @@ -906,6 +906,7 @@ set font_descs {
>>  }
>>  set default_config(gui.stageuntracked) ask
>>  set default_config(gui.displayuntracked) true
>> +set default_config(gui.autorescan) true
> 
> Default to false. See my reply to the cover letter for more info.
> 
> It would also be a good idea to include an option for this in the 
> options dialog. Check do_options in lib/options.tcl for examples.

Ok, I'll see if I can add a checkbox in the dialog. Might take a few
days until I have time for doing a re-roll.


>>  
>>  ######################################################################
>>  ##
>> @@ -4020,6 +4021,10 @@ bind .   <Alt-Key-2> {focus_widget $::ui_index}
>>  bind .   <Alt-Key-3> {focus $::ui_diff}
>>  bind .   <Alt-Key-4> {focus $::ui_comm}
>>  
>> +if {[is_config_true gui.autorescan]} {
>> +	bind .   <FocusIn>  schedule_rescan
>> +}
>> +
> 
> Ok.
> 
>>  set file_lists_last_clicked($ui_index) {}
>>  set file_lists_last_clicked($ui_workdir) {}
>>  
>> -- 
>> 2.29.2
>>
>
diff mbox series

Patch

diff --git a/git-gui.sh b/git-gui.sh
index 8864c14..4a4ac19 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -906,6 +906,7 @@  set font_descs {
 }
 set default_config(gui.stageuntracked) ask
 set default_config(gui.displayuntracked) true
+set default_config(gui.autorescan) true
 
 ######################################################################
 ##
@@ -4020,6 +4021,10 @@  bind .   <Alt-Key-2> {focus_widget $::ui_index}
 bind .   <Alt-Key-3> {focus $::ui_diff}
 bind .   <Alt-Key-4> {focus $::ui_comm}
 
+if {[is_config_true gui.autorescan]} {
+	bind .   <FocusIn>  schedule_rescan
+}
+
 set file_lists_last_clicked($ui_index) {}
 set file_lists_last_clicked($ui_workdir) {}