Re: [GIT-GUI PATCH] Teach git gui about file type changes
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Aug 25, 2008, 04:36 UTC
- Message-ID
- <20080825043604.GB19127@spearce.org>
- In-Reply-To
- <1219435827-11122-1-git-send-email-hendeby@isy.liu.se>
Gustaf Hendeby <hendeby@isy.liu.se> wrote:
> First of all, I'm really new to tcl/tk and the git gui code base so I > would appreciate any and all pointers here to make the changes > acceptable.
Your patch looks good, but I am squashing this into it. By using ?T rather than _T we can correctly handle MT, which I think happens when the user modifies the file content, stages the file, then changes the mode (644->755).
diff --git a/lib/index.tcl b/lib/index.tcl index 0a98715..7c27f2a 100644 --- a/lib/index.tcl +++ b/lib/index.tcl @@ -233,7 +233,7 @@ proc write_checkout_index {fd pathList totalCnt batch after} { switch -glob -- [lindex $file_states($path) 0] { U? {continue} ?M - - _T - + ?T - ?D { puts -nonewline $fd "[encoding convertto $path]\0" display_file $path ?_ @@ -300,7 +300,7 @@ proc add_helper {txt paths} { _O - ?M - ?D - - _T - + ?T - U? { lappend pathList $path if {$path eq $current_diff_path} { @@ -341,7 +341,7 @@ proc do_add_all {} { switch -glob -- [lindex $file_states($path) 0] { U? {continue} ?M - - _T - + ?T - ?D {lappend paths $path} } } @@ -359,7 +359,7 @@ proc revert_helper {txt paths} { switch -glob -- [lindex $file_states($path) 0] { U? {continue} ?M - - _T - + ?T - ?D { lappend pathList $path if {$path eq $current_diff_path} { > Secondly, I could really not come up with an icon to represent a type > change of a file. Right now it is just different from all the others > and not illustrative at all... I think the icon looks fine. I cannot come up with anything better myself.
-- Shawn.