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

[PATCH] pack-bitmap: clarify comment in filter_bitmap_exclude_type()

From
Taylor Blau <me@ttaylorr.com>
Date
Jul 20, 2021, 20:16 UTC
Message-ID
<0d52628985bf4f499e0d5622ea40cdf499e73ebe.1626812121.git.me@ttaylorr.com>

The code that eventually became filter_bitmap_exclude_type() was originally introduced in 4f3bd5606a (pack-bitmap: implement BLOB_NONE filtering, 2020-02-14) to accelerate BLOB_NONE filters with bitmaps.

In 856e12c18a (pack-bitmap.c: make object filtering functions generic, 2020-05-04), it became filter_bitmap_exclude_type(). But not all of the comments were updated to be agnostic to the provided type.

Remove the remaining comments which should have been updated in 856e12c18a to reflect the type-agnostic nature of the function.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
---
Noticed while I was reading some code in this area to see if we had
accelerated the relatively new type filters. This trivial fix hopefully
shouldn't produce conflicts with other in-flight bitmap series.
 pack-bitmap.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/pack-bitmap.c b/pack-bitmap.c
index bfc10148f5..c8cb9ef13b 100644
--- a/pack-bitmap.c
+++ b/pack-bitmap.c
@@ -809,8 +809,9 @@ static void filter_bitmap_exclude_type(struct bitmap_index *bitmap_git,
 	tips = find_tip_objects(bitmap_git, tip_objects, type);

 	/*
-	 * We can use the blob type-bitmap to work in whole words
-	 * for the objects that are actually in the bitmapped packfile.
+	 * We can use the type-level bitmap for 'type' to work in whole
+	 * words for the objects that are actually in the bitmapped
+	 * packfile.
 	 */
 	for (i = 0, init_type_iterator(&it, bitmap_git, type);
 	     i < to_filter->word_alloc && ewah_iterator_next(&mask, &it);
@@ -821,9 +822,9 @@ static void filter_bitmap_exclude_type(struct bitmap_index *bitmap_git,
 	}

 	/*
-	 * Clear any blobs that weren't in the packfile (and so would not have
-	 * been caught by the loop above. We'll have to check them
-	 * individually.
+	 * Clear any objects that weren't in the packfile (and so would
+	 * not have been caught by the loop above. We'll have to check
+	 * them individually.
 	 */
 	for (i = 0; i < eindex->count; i++) {
 		uint32_t pos = i + bitmap_git->pack->num_objects;
--
2.31.1.163.ga65ce7f831
Next: Jeff King
Message 1 of 4 in “pack-bitmap: clarify comment in filter_bitmap_exclude_type()”
  1. pack-bitmap: clarify comment in filter_bitmap_exclude_type()Taylor Blau, Jul 20, 2021
  2. Jeff KingJul 20, 2021
  3. Taylor BlauJul 20, 2021
  4. Jeff KingJul 20, 2021

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.