diff options
author | Patrick Steinhardt <ps@pks.im> | 2021-04-19 13:46:53 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-04-19 14:09:11 -0700 |
commit | b0c42a53c9d36ea69f4d2650001f05e98eb347cb (patch) | |
tree | d7560bc5644e2fc8d161722c9f54acb3356e1c44 /trailer.h | |
parent | list-objects: support filtering by tag and commit (diff) | |
download | tgif-b0c42a53c9d36ea69f4d2650001f05e98eb347cb.tar.xz |
list-objects: implement object type filter
While it already is possible to filter objects by some criteria in
git-rev-list(1), it is not yet possible to filter out only a specific
type of objects. This makes some filters less useful. The `blob:limit`
filter for example filters blobs such that only those which are smaller
than the given limit are returned. But it is unfit to ask only for these
smallish blobs, given that git-rev-list(1) will continue to print tags,
commits and trees.
Now that we have the infrastructure in place to also filter tags and
commits, we can improve this situation by implementing a new filter
which selects objects based on their type. Above query can thus
trivially be implemented with the following command:
$ git rev-list --objects --filter=object:type=blob \
--filter=blob:limit=200
Furthermore, this filter allows to optimize for certain other cases: if
for example only tags or commits have been selected, there is no need to
walk down trees.
The new filter is not yet supported in bitmaps. This is going to be
implemented in a subsequent commit.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'trailer.h')
0 files changed, 0 insertions, 0 deletions