git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/4] pack-bitmap.c: make object filtering functions generic

From
Junio C Hamano <gitster@pobox.com>
Date
May 5, 2020, 05:12 UTC
Message-ID
<xmqqd07jc6d4.fsf@gitster.c.googlers.com>
In-Reply-To
<b43a12894e7edf7d54ce2e9679f8db7dabec23e0.1588633810.git.me@ttaylorr.com>
Taylor Blau <me@ttaylorr.com> writes:
Show 14 quoted lines
> In 4f3bd5606a (pack-bitmap: implement BLOB_NONE filtering, 2020-02-14),
> filtering support for bitmaps was added for the 'LOFC_BLOB_NONE' filter.
>
> In the future, we would like to add support for filters that behave as
> if they exclude a certain type of object, for e.g., the tree depth
> filter with depth 0.
>
> To prepare for this, make some of the functions used for filtering more
> generic, such as 'find_tip_blobs' and 'filter_bitmap_blob_none' so that
> they can work over arbitrary object types.
>
> To that end, create 'find_tip_objects' and
> 'filter_bitmap_exclude_type', and redefine the aforementioned functions
> in terms of those.

OK, so instead of blobs at the tip, we find objects of requested type at the tip, which makes sense.

Similarly, blob_none filter used to exclude blobs at the tip, but a more generic form is to exclude objects of requested type at the tip.

And these "more generic" variants are named quite intuitively.

Then the blob_none filter becomes a thin wrapper of the more generic one, with hardcoded OBJ_BLOB type.

Nicely done.
Previous: Taylor BlauNext: Taylor Blau
Message 5 of 12 in “pack-bitmap: use bitmaps for traversals with '--filter=tree:0'”
  1. 0/4 pack-bitmap: use bitmaps for traversals with '--filter=tree:0'Taylor Blau, May 4, 2020
  2. 1/4 list-objects-filter: treat NULL filter_options as "disabled"Taylor Blau, May 4, 2020
  3. Junio C HamanoMay 5, 2020
  4. 2/4 pack-bitmap.c: make object filtering functions genericTaylor Blau, May 4, 2020
  5. Junio C HamanoMay 5, 2020
  6. 3/4 pack-bitmap.c: support 'tree:0' filteringTaylor Blau, May 4, 2020
  7. Junio C HamanoMay 5, 2020
  8. Taylor BlauMay 5, 2020
  9. Junio C HamanoMay 5, 2020
  10. 4/4 pack-bitmap: pass object filter to fill-in traversalTaylor Blau, May 4, 2020
  11. Junio C HamanoMay 5, 2020
  12. Taylor BlauMay 5, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.