git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
MKMartin Koegler <mkoegler@auto.tuwien.ac.at>
Date
Apr 30, 2007, 05:27 UTC
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:
Show 5 quoted lines
> 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.
Show 13 quoted lines
> > Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
> > ---
> > 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.

Show 17 quoted lines
> [...]  
> > +	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
Previous: Jakub NarebskiNext: Martin Koegler
Message 3 of 7 in “gitweb: Support comparing blobs with different names”
  1. 2/7 gitweb: Support comparing blobs with different namesMartin Koegler, Apr 16, 2007
  2. Jakub NarebskiApr 29, 2007
  3. Martin KoeglerApr 30, 2007
  4. 4/7 gitweb: Add treediff viewMartin Koegler, Apr 16, 2007
  5. Petr BaudisMay 18, 2007
  6. Martin KoeglerMay 19, 2007
  7. Petr BaudisMay 19, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.