Re: [RESEND] [PATCH] Fix tree mode of the file list for files containing curly brackets
From: Alex Riesen <hidden>
Date: 2016-06-15 22:44:32
Paul Mackerras, Sun, Apr 27, 2008 13:53:53 +0200:
Alex Riesen writes:quoted
As far as I could understand the online documentation the [lindex ...] thing expects an array, which a string produced by git-ls-tree is not. So [split ...] it first, to get a real Tcl string-array.Unfortunately that will do the wrong thing if the filename contains a tab character. I think the right thing is to split the line textually at the tab, then treat the first part as a list (which will be OK since it consists of words without special characters, separated by spaces), and the second part as the filename. That is what I was trying to do anyway, but I forgot to strip off the part after the tab, which is why lindex got unhappy with it. Here's the patch I'm about to commit.
FWIW, it does the right thing for me:
$ git init
Initialized empty Git repository in .git/
$ >a
$ git add .
$ gci -m.
Created initial commit 86ee2fa: .
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 a
$ git mv a ' { b } '
$ gci -m.
Created commit 2a90dc5: .
1 files changed, 0 insertions(+), 0 deletions(-)
rename a => { b } (100%)
$ gitk
$ happy
The program 'happy' is currently not installed. You can install it by typing:
sudo apt-get install happy
bash: happy: command not found