Re: [PATCH 4/4] cat-file: support --textconv/--filters in batch mode
- From
Jeff King <peff@peff.net>
- Date
- Aug 19, 2016, 14:44 UTC
- Message-ID
- <20160819144422.kkbskkthozfwfezp@sigill.intra.peff.net>
- In-Reply-To
- <alpine.DEB.2.20.1608191450500.4924@virtualbox>
On Fri, Aug 19, 2016 at 02:59:32PM +0200, Johannes Schindelin wrote:
Show 6 quoted lines
> > The only thing that somewhat is worrysome is what would happen to > > %(rest). > > What would happen is that it would print out the path, as it is exactly > that "rest" field that is used in the implementation, piggybacking on that > very nice feature.
Good, that is what I would expect to happen.
> Of course, this means that you simply cannot send "SHA-1 path rest" to > cat-file --batch and expect that to work. Should anybody need that in the > future, they can give it a try themselves to patch cat-file.
Right. The real motivation for %(rest) was to accept "git rev-list --objects" format, so you can do stuff like:
git rev-list --objects --all | git cat-file --batch-check='%(objectsize) %(rest)' | sort -rn | head
to get the paths of the largest objects. So the fact that "%(rest)" will be the filename in this case is almost certainly the most useful default (and if somebody really wants something else, they can try to figure out other semantics later).
-Peff