git-gui: Refactor add/remove proc names to align with reality.
Now that core Git refers to resetting paths in the index as "unstaging" the paths we should do the same in git-gui, both internally in our code and also within the menu action name. The same follows for our staging logic, as core Git refers to this as 'add'. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Jan 20, 2007 at 23:07 UTC
93e912c5e62220bd3cc2d00bfe357ed8fd44d413
1 file changed
+22
-22
git-gui.sh
+22
-22
@@ -2287,7 +2287,7 @@ proc do_rescan {} {
2287
rescan {set ui_status_value {Ready.}}
2288
}
2289
2290
-proc remove_helper {txt paths} {
2290
+proc unstage_helper {txt paths} {
2291
global file_states current_diff
2292
2293
if {![lock_index begin-update]} return
@@ -2316,21 +2316,21 @@ proc remove_helper {txt paths} {
2316
}
2317
}
2318
2319
-proc do_remove_selection {} {
2319
+proc do_unstage_selection {} {
2320
global current_diff selected_paths
2321
2322
if {[array size selected_paths] > 0} {
2323
- remove_helper \
2324
- {Removing selected files from commit} \
2323
+ unstage_helper \
2324
+ {Unstaging selected files from commit} \
2325
[array names selected_paths]
2326
} elseif {$current_diff ne {}} {
2327
- remove_helper \
2328
- "Removing [short_path $current_diff] from commit" \
2327
+ unstage_helper \
2328
+ "Unstaging [short_path $current_diff] from commit" \
2329
[list $current_diff]
2330
}
2331
}
2332
2333
-proc include_helper {txt paths} {
2333
+proc add_helper {txt paths} {
2334
global file_states current_diff
2335
2336
if {![lock_index begin-update]} return
@@ -2364,21 +2364,21 @@ proc include_helper {txt paths} {
2364
}
2365
}
2366
2367
-proc do_include_selection {} {
2367
+proc do_add_selection {} {
2368
global current_diff selected_paths
2369
2370
if {[array size selected_paths] > 0} {
2371
- include_helper \
2371
+ add_helper \
2372
{Adding selected files} \
2373
[array names selected_paths]
2374
} elseif {$current_diff ne {}} {
2375
- include_helper \
2375
+ add_helper \
2376
"Adding [short_path $current_diff]" \
2377
[list $current_diff]
2378
}
2379
}
2380
2381
-proc do_include_all {} {
2381
+proc do_add_all {} {
2382
global file_states
2383
2384
set paths [list]
@@ -2392,7 +2392,7 @@ proc do_include_all {} {
2392
_D {lappend paths $path}
2393
}
2394
}
2395
- include_helper \
2395
+ add_helper \
2396
{Adding all modified files} \
2397
$paths
2398
}
@@ -2873,7 +2873,7 @@ proc toggle_or_diff {w x y} {
2873
D_ -
2874
DO {
2875
update_indexinfo \
2876
- "Removing [short_path $path] from commit" \
2876
+ "Unstaging [short_path $path] from commit" \
2877
[list $path] \
2878
[concat $after {set ui_status_value {Ready.}}]
2879
}
@@ -3151,20 +3151,20 @@ lappend disable_on_lock \
3151
[list .mbar.commit entryconf [.mbar.commit index last] -state]
3152
3153
.mbar.commit add command -label {Add To Commit} \
3154
- -command do_include_selection \
3154
+ -command do_add_selection \
3155
-font font_ui
3156
lappend disable_on_lock \
3157
[list .mbar.commit entryconf [.mbar.commit index last] -state]
3158
3159
.mbar.commit add command -label {Add All To Commit} \
3160
- -command do_include_all \
3160
+ -command do_add_all \
3161
-accelerator $M1T-I \
3162
-font font_ui
3163
lappend disable_on_lock \
3164
[list .mbar.commit entryconf [.mbar.commit index last] -state]
3165
3166
-.mbar.commit add command -label {Remove From Commit} \
3167
- -command do_remove_selection \
3166
+.mbar.commit add command -label {Unstage From Commit} \
3167
+ -command do_unstage_selection \
3168
-font font_ui
3169
lappend disable_on_lock \
3170
[list .mbar.commit entryconf [.mbar.commit index last] -state]
@@ -3355,7 +3355,7 @@ lappend disable_on_lock \
3355
{.vpane.lower.commarea.buttons.rescan conf -state}
3356
3357
button .vpane.lower.commarea.buttons.incall -text {Add All} \
3358
- -command do_include_all \
3358
+ -command do_add_all \
3359
-font font_ui
3360
pack .vpane.lower.commarea.buttons.incall -side top -fill x
3361
lappend disable_on_lock \
@@ -3651,8 +3651,8 @@ unset gm
3651
# -- Key Bindings
3652
#
3653
bind $ui_comm <$M1B-Key-Return> {do_commit;break}
3654
-bind $ui_comm <$M1B-Key-i> {do_include_all;break}
3655
-bind $ui_comm <$M1B-Key-I> {do_include_all;break}
3654
+bind $ui_comm <$M1B-Key-i> {do_add_all;break}
3655
+bind $ui_comm <$M1B-Key-I> {do_add_all;break}
3656
bind $ui_comm <$M1B-Key-x> {tk_textCut %W;break}
3657
bind $ui_comm <$M1B-Key-X> {tk_textCut %W;break}
3658
bind $ui_comm <$M1B-Key-c> {tk_textCopy %W;break}
@@ -3681,8 +3681,8 @@ bind all <$M1B-Key-r> do_rescan
3681
bind all <$M1B-Key-R> do_rescan
3682
bind . <$M1B-Key-s> do_signoff
3683
bind . <$M1B-Key-S> do_signoff
3684
-bind . <$M1B-Key-i> do_include_all
3685
-bind . <$M1B-Key-I> do_include_all
3684
+bind . <$M1B-Key-i> do_add_all
3685
+bind . <$M1B-Key-I> do_add_all
3686
bind . <$M1B-Key-Return> do_commit
3687
bind all <$M1B-Key-q> do_quit
3688
bind all <$M1B-Key-Q> do_quit