Re: [PATCH 3/4] cat-file: add --batch-disk-sizes option
From: Jeff King <hidden>
Date: 2016-06-15 22:58:06
On Sun, Jul 07, 2013 at 10:49:46AM -0700, Junio C Hamano wrote:
Jeff King [off-list ref] writes:quoted
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