Re: [PATCH 3/4] cat-file: add --batch-disk-sizes option
- From
Jeff King <peff@peff.net>
- Date
- Jul 10, 2013, 11:04 UTC
- Message-ID
- <20130710110402.GD9724@sigill.intra.peff.net>
- In-Reply-To
- <7vtxk645vp.fsf@alter.siamese.dyndns.org>
On Sun, Jul 07, 2013 at 10:49:46AM -0700, Junio C Hamano wrote:
Show 11 quoted lines
> Jeff King <peff@peff.net> writes: > > > Perhaps we need > > > > git cat-file --batch-format="%(disk-size) %(object)" > > > > or similar. > > I agree with your reasoning. It may be simpler to give an interface > to ask for which pieces of info, e.g. --batch-cols=size,disksize, > without giving the readers a flexible "format".
I started on this, and it turned out not to really be any simpler. In particular there is the question of whether
git cat-file --batch-cols=size,type
is different from
git cat-file --batch-cols=type,size
If so, then you are basically implementing the equivalent of a macro format anyway (you have to parse it left to right to know the order). And if not, you end up translating the column list into a bit-field, and the boilerplate for adding a new item is about the same as for a macro format.
So I went ahead with the full formats for my re-roll. It turned out pretty reasonable, I think.
-Peff