Re: [PATCH 06/10] cat-file: add --batch-check=<format>
- From
Ramkumar Ramachandra <artagnon@gmail.com>
- Date
- Jul 10, 2013, 14:51 UTC
- Message-ID
- <CALkWK0=RtB2ddpGhZO0RAjzQXNfxHBE47bnp6KaVFz=Hicj8sw@mail.gmail.com>
- In-Reply-To
- <20130710114546.GF21963@sigill.intra.peff.net>
Jeff King wrote:
Show 14 quoted lines
> +If `--batch` or `--batch-check` is given, `cat-file` will read objects > +from stdin, one per line, and print information about them. > + > +You can specify the information shown for each object by using a custom > +`<format>`. The `<format>` is copied literally to stdout for each > +object, with placeholders of the form `%(atom)` expanded, followed by a > +newline. The available atoms are: > + > +If no format is specified, the default format is `%(objectname) > +%(objecttype) %(objectsize)`. > + > +If `--batch` is specified, the object information is followed by the > +object contents (consisting of `%(objectsize)` bytes), followed by a > +newline.
I find this slightly hideous, and would have expected an %(objectcontents) or similar.
Perhaps --batch-check should become a non-configurable alias for --batch="%(objectname) %(objecttype) %(objectsize)", and let --batch default to the format "%(objectname) %(objecttype) %(objectsize) %(objectcontents)".
I'm frankly okay with not having --pretty, and making the output in the non-batch mode non-configurable (does anyone care?).