Re: [PATCH 3/4] cat-file: add --batch-disk-sizes option
- From
Ramkumar Ramachandra <artagnon@gmail.com>
- Date
- Jul 8, 2013, 12:00 UTC
- Message-ID
- <CALkWK0ktNK49zBM4tD8fpNN3VMan7DegfWRtDcOEgTyEbSK9Uw@mail.gmail.com>
- In-Reply-To
- <CACsJy8A8ZO3DL8Vr=S1G-3yiJz3WaZ-7jV_eA+v6rPAWrd9NAw@mail.gmail.com>
Duy Nguyen wrote:
> Ram, are you still interested in the awesome branch series?
Yep, but it got stalled due to lack of reviewer-interest :/
I'm a bit under the weather at the moment, but it's good to see that you're back: let's finish this soon.
Show 11 quoted lines
>>> Perhaps we need >>> >>> git cat-file --batch-format="%(disk-size) %(object)" >>> >>> or similar. > > This is what I wanted to do with the in for-each-ref's pretty > formatting [1]. I used to hack cat-file --batch to extract info I > needed for experimenting with various pack index extensions. If you > are not in hurry, maybe we can introduce something similar to your > syntax, but applicable for all for-each-ref, branch and log family.
I'm still quite confused about this "grand plan". We have short commit-specific format specifiers that don't work with refs, among several other quirks in [1]. I personally think we should absolutely stay away from short format-specifiers (like %H, %f, %e; we'll soon run out of letters, and nobody can tell what they are without the documentation anyway) for the new options, and just start adding new long-form ones as and when they are necessary. I think refname:short, upstream:track, upstream:trackshort are very sensible choices, and that we should continue along that line. I'm fine with format-specifiers having meanings only in certain contexts as long as we document it properly (how can we possibly get %(refname) to mean something sensible in cat-file?).
As far as this series is concerned, I think Peff can implement %H and %(object:[disk-]size) locally without worrying about code-sharing or waiting for us. Then, after the for-each-ref-pretty thing matures, we can just replace the code underneath.