@matheusbsbs / matheus-bagliano / commits / e681cb7d6a
Fork 0

git-gui: Teach git gui about file type changes

Signed-off-by: Gustaf Hendeby <hendeby@isy.liu.se> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Gustaf Hendeby committed Aug 22, 2008 at 22:10 UTC e681cb7d6a00b4860c84bf8ca7b8d8dab366c9fc
3 files changed +26 -1
git-gui.sh
+17 -1
@@ -1619,6 +1619,15 @@ static unsigned char file_merge_bits[] = {
1619 0xfa, 0x17, 0x02, 0x10, 0xfe, 0x1f};
1620 } -maskdata $filemask
1621
1622 +image create bitmap file_statechange -background white -foreground green -data {
1623 +#define file_merge_width 14
1624 +#define file_merge_height 15
1625 +static unsigned char file_statechange_bits[] = {
1626 + 0xfe, 0x01, 0x02, 0x03, 0x02, 0x05, 0x02, 0x09, 0x02, 0x1f, 0x62, 0x10,
1627 + 0x62, 0x10, 0xba, 0x11, 0xba, 0x11, 0x62, 0x10, 0x62, 0x10, 0x02, 0x10,
1628 + 0x02, 0x10, 0x02, 0x10, 0xfe, 0x1f};
1629 +} -maskdata $filemask
1630 +
1631 set ui_index .vpane.files.index.list
1632 set ui_workdir .vpane.files.workdir.list
1633
@@ -1627,12 +1636,14 @@ set all_icons(A$ui_index) file_fulltick
1636 set all_icons(M$ui_index) file_fulltick
1637 set all_icons(D$ui_index) file_removed
1638 set all_icons(U$ui_index) file_merge
1639 +set all_icons(T$ui_index) file_statechange
1640
1641 set all_icons(_$ui_workdir) file_plain
1642 set all_icons(M$ui_workdir) file_mod
1643 set all_icons(D$ui_workdir) file_question
1644 set all_icons(U$ui_workdir) file_merge
1645 set all_icons(O$ui_workdir) file_plain
1646 +set all_icons(T$ui_workdir) file_statechange
1647
1648 set max_status_desc 0
1649 foreach i {
@@ -1643,6 +1654,9 @@ foreach i {
1654 {MM {mc "Portions staged for commit"}}
1655 {MD {mc "Staged for commit, missing"}}
1656
1657 + {_T {mc "File type changed, not staged"}}
1658 + {T_ {mc "File type changed, staged"}}
1659 +
1660 {_O {mc "Untracked, not staged"}}
1661 {A_ {mc "Staged for commit"}}
1662 {AM {mc "Portions staged for commit"}}
@@ -2757,7 +2771,9 @@ proc popup_diff_menu {ctxm x y X Y} {
2771 if {$::is_3way_diff
2772 || $current_diff_path eq {}
2773 || ![info exists file_states($current_diff_path)]
2760 - || {_O} eq [lindex $file_states($current_diff_path) 0]} {
2774 + || {_O} eq [lindex $file_states($current_diff_path) 0]
2775 + || {_T} eq [lindex $file_states($current_diff_path) 0]
2776 + || {T_} eq [lindex $file_states($current_diff_path) 0]} {
2777 set s disabled
2778 } else {
2779 set s normal
lib/commit.tcl
+2
@@ -149,6 +149,7 @@ The rescan will be automatically started now.
149 _? {continue}
150 A? -
151 D? -
152 + T_ -
153 M? {set files_ready 1}
154 U? {
155 error_popup [mc "Unmerged files cannot be committed.
@@ -428,6 +429,7 @@ A rescan will be automatically started now.
429 __ -
430 A_ -
431 M_ -
432 + T_ -
433 D_ {
434 unset file_states($path)
435 catch {unset selected_paths($path)}
lib/index.tcl
+7
@@ -99,6 +99,7 @@ proc write_update_indexinfo {fd pathList totalCnt batch after} {
99 switch -glob -- [lindex $s 0] {
100 A? {set new _O}
101 M? {set new _M}
102 + T_ {set new _T}
103 D_ {set new _D}
104 D? {set new _?}
105 ?? {continue}
@@ -162,6 +163,7 @@ proc write_update_index {fd pathList totalCnt batch after} {
163 ?D {set new D_}
164 _O -
165 AM {set new A_}
166 + _T {set new T_}
167 U? {
168 if {[file exists $path]} {
169 set new M_
@@ -231,6 +233,7 @@ proc write_checkout_index {fd pathList totalCnt batch after} {
233 switch -glob -- [lindex $file_states($path) 0] {
234 U? {continue}
235 ?M -
236 + ?T -
237 ?D {
238 puts -nonewline $fd "[encoding convertto $path]\0"
239 display_file $path ?_
@@ -252,6 +255,7 @@ proc unstage_helper {txt paths} {
255 switch -glob -- [lindex $file_states($path) 0] {
256 A? -
257 M? -
258 + T_ -
259 D? {
260 lappend pathList $path
261 if {$path eq $current_diff_path} {
@@ -296,6 +300,7 @@ proc add_helper {txt paths} {
300 _O -
301 ?M -
302 ?D -
303 + ?T -
304 U? {
305 lappend pathList $path
306 if {$path eq $current_diff_path} {
@@ -336,6 +341,7 @@ proc do_add_all {} {
341 switch -glob -- [lindex $file_states($path) 0] {
342 U? {continue}
343 ?M -
344 + ?T -
345 ?D {lappend paths $path}
346 }
347 }
@@ -353,6 +359,7 @@ proc revert_helper {txt paths} {
359 switch -glob -- [lindex $file_states($path) 0] {
360 U? {continue}
361 ?M -
362 + ?T -
363 ?D {
364 lappend pathList $path
365 if {$path eq $current_diff_path} {