Re: git log and utf-u in filenames
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Sep 27, 2008, 08:37 UTC
- Message-ID
- <200809271037.13571.jnareb@gmail.com>
- In-Reply-To
- <81b0412b0809260649n7d7c0ccbwfde5504157687cda@mail.gmail.com>
On Fri, 26 Sep 2008, Alex Riesen wrote:
> 2008/9/26 Jakub Narebski <jnareb@gmail.com>:
Show 17 quoted lines
>>> 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.Currently gitweb does something like this:
open $fd, "-|", git_cmd(), "diff-tree", '-r', ...
@difftree = <$fd>;
close $fd;
foreach my $line (@difftree) {
...
}If gitweb would use git-diff-tree with '-z' option, above code would get more complicated, offsetting simplification of not using unquote() (which is already written).
-- Jakub Narebski Poland