From: Alex Riesen Date: Fri, 26 Sep 2008 13:49:06 GMT Subject: Re: git log and utf-u in filenames Message-ID: <81b0412b0809260649n7d7c0ccbwfde5504157687cda@mail.gmail.com> In-Reply-To: <200809260931.21883.jnareb@gmail.com> 2008/9/26 Jakub Narebski : > 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 > .... TAB LF > > git diff-tree -z > .... NUL NUL > You still have the marker (Rnnn) from pre- record and can treat the next record correspondingly. Still a split, just a bit more careful handling of the resulting list/array.