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

Re: [RFC/PATCH 2/2] gitweb: Add an option to show size of blobs in the tree view

From
Jakub Narebski <jnareb@gmail.com>
Date
Aug 1, 2007, 13:05 UTC
Message-ID
<200708011505.02078.jnareb@gmail.com>
In-Reply-To
<7vd4y8fcjw.fsf@assigned-by-dhcp.cox.net>
On Wed, 1 Aug 2007, Junio C Hamano wrote:
Show 18 quoted lines
> Jakub Narebski <jnareb@gmail.com> writes:
> 
>> It allows to play with 'tree' view with blob size. Currently you
>> have to start browsing by adding ";opt=-l" to the gitweb URL by
>> hand.  There is not link which will change view from ordinary 'tree'
>> view to 'tree' view with blob sizes.
>>
>> The 'tree' with blob size view is slightly more costly than the
>> ordinary, old 'tree' view, but not much more (0.018s vs 0.012s
>> in the hot cache case), so I don't think we need to control it
>> as a enabled (or disabled) feature, overrideable or not.  It
>> probably should not be default.
> 
> I do not think there is any reason to forbid its use, as the
> "-l" to ls-tree was introduced for exactly this purpose,
> However, it might make sense to make the use of -l optional via
> the %feature mechanism.  50% increase even on hot cache case is
> not a price people who run busy sites would want to pay.

It's 0.014s vs 0.009s - 0.010s on root dir of repacked git.git repository. It is I think caused by the fact that "git ls-tree -l <tree-ish>" has to look up each blob in the tree, and read its header. IIRC header is uncompressed, so it doesn't need deflating; if it is compressed, then we have to add deflating to that. The blob size (object size) is not present in the tree object structure. Perhaps it is something to have in mind when designing and implementing new packv4 with its creating tree objects on demand.

But I agree that this should be protected by the %feature mechanism. Two questions:

 1. Should we make '-l' default when turned on? Or make 'showsizes'
    %feature tristate: off, on, by default on?
 2. If it is turned off, should we silently (or not so silently)
    ignore this option, or return "Permission denied" or perhaps
    "Invalid extra options parameter"?
And how we should name this feature (key in %feature hash)?
P.S. I have received no comments on
 [RFC/PATCH] gitweb: Enable transparent compression for HTTP output
(trade CPU load for lower bandwidth usage).
-- 
Jakub Narebski
Poland
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 11 in “gitweb: Allow for multivalued parameters passed to href subroutine”
  1. 1/2 gitweb: Allow for multivalued parameters passed to href subroutineJakub Narebski, Jul 31, 2007
  2. 2/2 gitweb: Add an option to show size of blobs in the tree viewJakub Narebski, Jul 31, 2007
  3. Junio C HamanoJul 31, 2007
  4. Jakub NarebskiAug 1, 2007
  5. Junio C HamanoAug 1, 2007
  6. Jakub NarebskiAug 1, 2007
  7. Junio C HamanoAug 2, 2007
  8. Junio C HamanoAug 2, 2007
  9. Jakub NarebskiAug 2, 2007
  10. Junio C HamanoAug 2, 2007
  11. Jakub NarebskiJul 31, 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.