Re: [PATCH 2/7] gitweb: Support comparing blobs with different names

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <mkoegler@xxxxxxxxxxxxxxxxx>
> > ---
> > 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 <tree>:<path> form
> respects mode changes information.

Addressed in new patch.

mfg Martin Kögler
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]