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

Re: git log and utf-u in filenames

From
Alex Riesen <raa.lkml@gmail.com>
Date
Sep 26, 2008, 13:49 UTC
Message-ID
<81b0412b0809260649n7d7c0ccbwfde5504157687cda@mail.gmail.com>
In-Reply-To
<200809260931.21883.jnareb@gmail.com>
2008/9/26 Jakub Narebski <jnareb@gmail.com>:
Show 21 quoted lines
> On Fri, 26 Sep 2008, Alex Riesen wrote:
>> Jakub Narebski, Fri, Sep 26, 2008 01:15:58 +0200:
>> >
>> > Well, in gitweb we could use '-z' option for git-diff-tree and git-ls-tree,
>> > but it has its disadvantages, like having to do actual parsing record after
>> > record instead of simplys splitting outout on end of line ("\n") characters.
>> >
>>
>> How about simply splitting output on end of line ("\0" NUL) characters?
>> The "\n" NL you refer to is just as EOR as NUL.
>
> Doesn't work for "git diff-tree -z [...]" output. When there is rename
> or copy detected, NUL is used as separator between fields (beetween
> source and destination unquoted filename), not only between records:
>
>  git diff-tree
>      .... <src qfilename> TAB <dst qfilename> LF
>
>  git diff-tree -z
>      .... <src filename>  NUL <dst filename>  NUL
>

You still have the marker (Rnnn) from pre-<src filename> record and can treat the next record correspondingly. Still a split, just a bit more careful handling of the resulting list/array.

Previous: Jakub NarebskiNext: Jakub Narebski
Message 6 of 8 in “git log and utf-u in filenames”
  1. Joey HessSep 25, 2008
  2. Joey HessSep 25, 2008
  3. Jakub NarebskiSep 25, 2008
  4. Alex RiesenSep 26, 2008
  5. Jakub NarebskiSep 26, 2008
  6. Alex RiesenSep 26, 2008
  7. Jakub NarebskiSep 27, 2008
  8. Jakub NarebskiSep 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.