summaryrefslogtreecommitdiff
path: root/git-gui
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2006-11-19 05:37:49 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2006-11-19 05:37:49 (GMT)
commit74d18d2edfc84d35b20e1b4520e496aadc14c365 (patch)
tree0a9cea12f91a4c299192171e5eaf09da0f698b89 /git-gui
parent1461c5f3d0634f6fad0013eba1ef1087a38cc748 (diff)
downloadgit-74d18d2edfc84d35b20e1b4520e496aadc14c365.zip
git-74d18d2edfc84d35b20e1b4520e496aadc14c365.tar.gz
git-74d18d2edfc84d35b20e1b4520e496aadc14c365.tar.bz2
git-gui: Make consecutive icon clicks toggle included status of a file.
If the user clicks on the icon associated with a file we now flip to the inverse status. Partially included files first fully include, then fully uninclude, as we don't keep track of intermediate partial inclusions. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'git-gui')
-rwxr-xr-xgit-gui23
1 files changed, 18 insertions, 5 deletions
diff --git a/git-gui b/git-gui
index 6b886c6..7126f8d 100755
--- a/git-gui
+++ b/git-gui
@@ -2387,7 +2387,7 @@ proc do_macosx_app {} {
}
proc toggle_or_diff {w x y} {
- global file_lists current_diff ui_index ui_other
+ global file_states file_lists current_diff ui_index ui_other
global last_clicked selected_paths
set pos [split [$w index @$x,$y] .]
@@ -2410,10 +2410,23 @@ proc toggle_or_diff {w x y} {
} else {
set after {}
}
- update_index \
- "Including [short_path $path]" \
- [list $path] \
- [concat $after {set ui_status_value {Ready.}}]
+ switch -glob -- [lindex $file_states($path) 0] {
+ A_ -
+ AO -
+ M_ -
+ D_ {
+ update_indexinfo \
+ "Removing [short_path $path] from commit" \
+ [list $path] \
+ [concat $after {set ui_status_value {Ready.}}]
+ }
+ ?? {
+ update_index \
+ "Including [short_path $path]" \
+ [list $path] \
+ [concat $after {set ui_status_value {Ready.}}]
+ }
+ }
} else {
show_diff $path $w $lno
}