git-gui: learn more type change states
Support the following states with type change in git-gui: AT, MT, TD, TM Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Bert Wesarg committed
Dec 9, 2010 at 21:46 UTC
7587f4d32f7479a9fa9ae1767708597702a0be5f
3 files changed
+19
-5
git-gui.sh
+6
-2
@@ -1997,7 +1997,11 @@ foreach i {
1997
{MD {mc "Staged for commit, missing"}}
1998
1999
{_T {mc "File type changed, not staged"}}
2000
+ {MT {mc "File type changed, old type staged for commit"}}
2001
+ {AT {mc "File type changed, old type staged for commit"}}
2002
{T_ {mc "File type changed, staged"}}
2003
+ {TM {mc "File type change staged, modification not staged"}}
2004
+ {TD {mc "File type change staged, file missing"}}
2005
2006
{_O {mc "Untracked, not staged"}}
2007
{A_ {mc "Staged for commit"}}
@@ -3539,8 +3543,8 @@ proc popup_diff_menu {ctxm ctxmmg ctxmsm x y X Y} {
3543
|| $current_diff_path eq {}
3544
|| {__} eq $state
3545
|| {_O} eq $state
3542
- || {_T} eq $state
3543
- || {T_} eq $state
3546
+ || [string match {?T} $state]
3547
+ || [string match {T?} $state]
3548
|| [has_textconv $current_diff_path]} {
3549
set s disabled
3550
} else {
lib/commit.tcl
+5
-1
@@ -166,7 +166,7 @@ The rescan will be automatically started now.
166
_? {continue}
167
A? -
168
D? -
169
- T_ -
169
+ T? -
170
M? {set files_ready 1}
171
_U -
172
U? {
@@ -453,7 +453,11 @@ A rescan will be automatically started now.
453
}
454
AM -
455
AD -
456
+ AT -
457
+ TM -
458
+ TD -
459
MM -
460
+ MT -
461
MD {
462
set file_states($path) [list \
463
_[string index $m 1] \
lib/index.tcl
+8
-2
@@ -103,8 +103,11 @@ proc write_update_indexinfo {fd pathList totalCnt batch after} {
103
set s $file_states($path)
104
switch -glob -- [lindex $s 0] {
105
A? {set new _O}
106
- M? {set new _M}
106
+ MT -
107
+ TM -
108
T_ {set new _T}
109
+ M? {set new _M}
110
+ TD -
111
D_ {set new _D}
112
D? {set new _?}
113
?? {continue}
@@ -167,7 +170,10 @@ proc write_update_index {fd pathList totalCnt batch after} {
170
AD {set new __}
171
?D {set new D_}
172
_O -
173
+ AT -
174
AM {set new A_}
175
+ TM -
176
+ MT -
177
_T {set new T_}
178
_U -
179
U? {
@@ -261,7 +267,7 @@ proc unstage_helper {txt paths} {
267
switch -glob -- [lindex $file_states($path) 0] {
268
A? -
269
M? -
264
- T_ -
270
+ T? -
271
D? {
272
lappend pathList $path
273
if {$path eq $current_diff_path} {