From: Martin Koegler Date: Mon, 30 Apr 2007 05:27:02 GMT Subject: Re: [PATCH 2/7] gitweb: Support comparing blobs with different names Message-ID: <20070430052702.GA12744@auto.tuwien.ac.at> In-Reply-To: <200704292335.50102.jnareb@gmail.com> On Sun, Apr 29, 2007 at 11:35:49PM +0200, Jakub Narebski wrote: > On Monday, 16 April 2007, Martin Koegler wrote: > > > Currently, blobdiff can only compare blobs with different file > > names, if no hb/hpb parameters are present. > > I've already posted a new version of this patch: http://www.spinics.net/lists/git/msg28812.html Can you please look at it. > > Signed-off-by: Martin Koegler > > --- > > New version, as I found a bug in the expiration handling code. > > > > I unified all blobdiff variants and added support for comparing blobs > > with different names. > > > > If h/hp parameter are missing, I need to generate them with > > git_get_hash_by_path, as the are needed for the html header, which is > > generated before parsing the git-diff output. > > git_get_hash_by_path uses git-ls-tree but it does not catch all the info; > perhaps git_get_info_by_path would be called for here. I now only need the hash of the blob, if not passed as parameter, to generate a correct header. > [...] > > + if (defined $hash_parent_base && defined $file_parent && !defined $hash_parent) { > > + $hash_parent = git_get_hash_by_path($hash_parent_base, $file_parent); > > + } > [...] > > + # open patch output > > + open $fd, "-|", git_cmd(), "diff", @diff_opts, > > + $hash_parent, $hash, "--" > > + or die_error(undef, "Open git-diff failed"); > > You would most probably use now "$hash_base:$file_name" instead of $hash > if $hash_base is defined, i.e. > > defined $hash_base ? "$hash_base:$file_name" : $hash > > and similarly for $hash_parent parameter now that : form > respects mode changes information. Addressed in new patch. mfg Martin Kögler