git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Gustaf Hendeby
Message 2 of 2 in “Teach git gui about file type changes”
  1. Teach git gui about file type changesGustaf Hendeby, Aug 22, 2008
  2. Shawn O. PearceAug 25, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.