Subject: Re: [PATCH/RFC 1/x] gitweb: Use git-diff-tree patch output for commitdiff

From: Jakub Narebski <[email-masked]>
Date: Thu, 24 Aug 2006 20:56:47 +0200

Junio C Hamano wrote:

> Jakub Narebski <[email-masked]> writes:
> 
>> Junio C Hamano wrote:
>>
>>> Jakub Narebski <[email-masked]> writes:
>>> 
>>>> Converting "blobdiff" and "blobdiff_plain" format would be much easier
>>>> if git-diff-tree and friends had -L <label>/--label=<label> option,
>>>> like GNU diff has.
>>> 
>>> I am not sure how that would be useful, given that you would
>>> disect the header line-by-line to colorize anyway.
>>
>> gitweb could output patch directly (slurp-print) in blobdiff_plain,
>> if there were -L <label>/--label=<label> option to git-diff. As it is now
>> git_blobdiff_plain (or git_blobdiff('plain')) would have to process diff
>> header, replacing hashes by file names.
> 
> I do not think gitweb does diff between two arbitrary blobs; in
> other words, you only need "diff-tree treeA treeB -- path".

gitweb didn't pass parent commit (i.e. treeB) information for blobdiff,
and IIRC passed only blob hashes for blobdiff_plain (and not passed
filename aka path).

> I think feeding object names _is_ what's causing you trouble.

As I said:
>> Anyway to get full information you need commits to diff, not only blobs to
>> diff, otherwise the mode change information is lost, I think. And then we
>> would be able to reuse git_patchset_body for git_blobdiff... 
 
Instead of using hash and hash_parent parameters for tree-ish and 
tree_parent-ish hashes (instead of blob hashes as it is now), I have 
used in patch (in this thread):

  [PATCH 10] gitweb: Add support for hash_parent_base parameter for blobdiffs

hash_base and (newly introduced) hash_parent_base arguments/parameters.

Not used yet, but planned.
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git