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

[PATCH] gitk doesn't handle filenames with space correctly

From
FJFrédéric Jolliton <gmane@frederic.jolliton.com>
Date
Apr 7, 2007, 01:22 UTC
Message-ID
<86slbd6kr0.fsf@mau.intra.tuxee.net>
Hi,

Here is an attempt to fix gitk such that it can display filenames with space correctly, in the right column (Patch/Tree). I don't know TCL, so probably that a better solution exists.

--- gitk.orig 2007-04-07 02:36:05.000000000 +0200 +++ gitk 2007-04-07 03:13:16.000000000 +0200

@@ -4114,8 +4114,7 @@
 
     while {[gets $gtf line] >= 0} {
 	if {[lindex $line 1] ne "blob"} continue
-	set sha1 [lindex $line 2]
-	set fname [lindex $line 3]
+	regexp {^[^ ]+ [^ ]+ ([^ ]+)\t(.*)} $line -> sha1 fname
 	lappend treefilelist($id) $fname
 	lappend treeidlist($id) $sha1
     }
@@ -4324,7 +4323,7 @@
 	}
 	return
     }
-    set file [lindex $line 5]
+    regexp {^[^ ]+ [^ ]+ [^ ]+ [^ ]+ [^ ]+\t(.*)} $line -> file
     lappend treediff $file
 }
-- 
Frédéric Jolliton
Next: Bernt Hansen
Message 1 of 2 in “gitk doesn't handle filenames with space correctly”
  1. gitk doesn't handle filenames with space correctlyFrédéric Jolliton, Apr 7, 2007
  2. Bernt HansenApr 12, 2007

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.