From: "Shawn O. Pearce" <spearce@spearce.org>
To: Junio C Hamano <junkio@cox.net>
Cc: Jakub Narebski <jnareb@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH] Add an option to git-ls-tree to display also the size of object
Date: Tue, 15 May 2007 19:20:17 -0400 [thread overview]
Message-ID: <20070515232017.GP3141@spearce.org> (raw)
In-Reply-To: <7vy7jpj4lr.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> wrote:
> Jakub Narebski <jnareb@gmail.com> writes:
>
> > Add -l/--long/--size option to git-ls-tree command, which displays
> > object size of an entry after object id (left-justified with minimum
> > width of 7 characters).
>
> Also I suspect that having to show the size of a tree object,
> expressed in terms of the canonical representation, might
> force packv4 aware ls-tree to convert its traversal efficient
> representation to the canonical one only to get its size.
Yes, you are right Junio. In pack v4 we don't know the size of
the canonical representation. We compute it on the fly when its
needed by summing up the lengths of the names of each element in
the tree, so it requires us to expand the delta chain and is thus
O(delta_depth * entry_count) or something like that.
I didn't see this as a huge problem, as the only in-tree caller at
the time that needed the size and did not also want the canonical
representation was the -s flag to cat-file.
So I'm kind of against adding something that would want to print
that canonical representation for every subtree in a parent tree,
as it would make either pack v4 less efficient for that operation
or force it to store the canonical size, for no other good reason.
--
Shawn.
prev parent reply other threads:[~2007-05-15 23:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-15 10:24 [PATCH] Add an option to git-ls-tree to display also the size of object Jakub Narebski
2007-05-15 18:58 ` Junio C Hamano
2007-05-15 23:19 ` Jakub Narebski
2007-05-16 0:37 ` Junio C Hamano
2007-05-16 0:54 ` Jakub Narebski
2007-05-16 1:07 ` Junio C Hamano
2007-05-19 20:08 ` [PATCH v2] Add an option to git-ls-tree to display also the size of blob Jakub Narebski
2007-05-20 3:54 ` Shawn O. Pearce
2007-05-15 23:20 ` Shawn O. Pearce [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070515232017.GP3141@spearce.org \
--to=spearce@spearce.org \
--cc=git@vger.kernel.org \
--cc=jnareb@gmail.com \
--cc=junkio@cox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.