threads / patch / 4926

patchDisplay "gitweb/test/file with spaces" in gitk

Subject: [PATCH] Display "gitweb/test/file with spaces" in gitk

## tl;dr

2 messages between Jul 20, 2006 and Jul 21, 2006. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Thomas Kolejka· Jul 20, 2006, 10:12 UTC · lore
Hello,

with this patch files with spaces in their names are displayed in the treeview of gitk.

I use git to make a "backup"/"dump" of a DOS-FS .. and there are those filenames ;-).

Take care .. it's my first tcl hack!
Thomas
--
Show changes to gitk +2 −2
diff --git a/gitk b/gitk
index ba4644f..93af19c 100755
--- a/gitk
+++ b/gitk
@@ -3938,7 +3938,7 @@ proc gettreeline {gtf id} {
     while {[gets $gtf line] >= 0} {
        if {[lindex $line 1] ne "blob"} continue
        set sha1 [lindex $line 2]
-       set fname [lindex $line 3]
+       set fname [join [lrange $line 3 end]]
        lappend treefilelist($id) $fname
        lappend treeidlist($id) $sha1
     }
@@ -4147,7 +4147,7 @@ proc gettreediffline {gdtf ids} {
        }
        return
     }
-    set file [lindex $line 5]
+    set file [join [lrange $line 5 end]]
     lappend treediff $file
 }
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
Paul Mackerras· Jul 21, 2006, 13:01 UTC · re: Thomas Kolejka · lore

Re: [PATCH] Display "gitweb/test/file with spaces" in gitk

Thomas Kolejka writes:
Show 5 quoted lines
> with this patch files with spaces in their names are displayed
> in the treeview of gitk.
> 
> I use git to make a "backup"/"dump" of a DOS-FS .. and there are 
> those filenames ;-).

Hmmm, certainly my code is incorrect. However with your code, tabs in the filename will get changed to spaces. Treating the line read from git-ls-tree or git-diff-tree was a shortcut hack that isn't really optimal. I'll think about the best way to fix it.

Paul.

← back to recent threads