Re: [Question] Can git cat-file have a type filtering option?
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Apr 10, 2023, 23:20 UTC
- Message-ID
- <ZDSZs8LgZzDLf5m1@nand.local>
- In-Reply-To
- <20230410200141.GB104097@coredump.intra.peff.net>
On Mon, Apr 10, 2023 at 04:01:41PM -0400, Jeff King wrote:
> For that reason, and just for general flexibility, I think you are > mostly better off piping cat-file through an external filter program > (and then back to cat-file to get more data on each object).
Yeah, agreed. The convention of printing objects listed on the command-line regardless of whether they would pass through the object filter is confusing to me, too.
But using `rev-list --no-walk` to accomplish the same job for a filter as trivial as the type-level one feels overkill anyway, so I agree that just relying on `cat-file` to produce the list of objects, filtering it yourself, and then handing it back to `cat-file` is the easiest thing to do.
Thanks, Taylor