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

Re: [RESEND] [PATCH] Fix tree mode of the file list for files containing curly brackets

From
Alex Riesen <raa.lkml@gmail.com>
Date
Apr 27, 2008, 16:51 UTC
Message-ID
<20080427165156.GA3828@steel.home>
In-Reply-To
<18452.26961.14738.430774@cargo.ozlabs.ibm.com>
Paul Mackerras, Sun, Apr 27, 2008 13:53:53 +0200:
Show 15 quoted lines
> Alex Riesen writes:
> 
> > 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
Previous: Paul Mackerras
Message 5 of 5 in “Fix tree mode of the file list for files containing curly brackets”
  1. Alex RiesenMar 14, 2008
  2. Fix tree mode of the file list for files containing curly bracketsAlex Riesen, Mar 14, 2008
  3. [RESEND] [PATCH] Fix tree mode of the file list for files containing curly bracketsAlex Riesen, Apr 27, 2008
  4. Paul MackerrasApr 27, 2008
  5. Alex RiesenApr 27, 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.