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

Re: Git Test Coverage Report (April 16, 2020)

From
Derrick Stolee <stolee@gmail.com>
Date
Apr 16, 2020, 14:08 UTC
Message-ID
<d4bf43d8-0d56-bbb9-e68f-a4933dacd3d3@gmail.com>
In-Reply-To
<c797df50-ec21-98a3-58c4-ade0c04284c9@gmail.com>
On 4/16/2020 9:57 AM, Derrick Stolee wrote:
Show 35 quoted lines
> Derrick Stolee	efb0e3a0 blame: use changed-path Bloom filters
> blame.c
> efb0e3a0 1276) if (origin->commit->generation == GENERATION_NUMBER_INFINITY)
> efb0e3a0 1277) return 1;
> efb0e3a0 1279) filter = get_bloom_filter(r, origin->commit, 0);
> efb0e3a0 1281) if (!filter)
> efb0e3a0 1282) return 1;
> efb0e3a0 1284) bloom_count_queries++;
> efb0e3a0 1285) for (i = 0; i < bd->nr; i++) {
> efb0e3a0 1286) if (bloom_filter_contains(filter,
> efb0e3a0 1287)   bd->keys[i],
> efb0e3a0 1288)   bd->settings))
> efb0e3a0 1289) return 1;
> efb0e3a0 1292) bloom_count_no++;
> efb0e3a0 1293) return 0;
> efb0e3a0 1302) if (bd->nr >= bd->alloc) {
> efb0e3a0 1303) bd->alloc *= 2;
> efb0e3a0 1304) REALLOC_ARRAY(bd->keys, bd->alloc);
> efb0e3a0 1307) bd->keys[bd->nr] = xmalloc(sizeof(struct bloom_key));
> efb0e3a0 1308) fill_bloom_key(path, strlen(path), bd->keys[bd->nr], bd->settings);
> efb0e3a0 1309) bd->nr++;
> efb0e3a0 2903) bd = xmalloc(sizeof(struct blame_bloom_data));
> efb0e3a0 2905) bd->settings = sb->repo->objects->commit_graph->bloom_filter_settings;
> efb0e3a0 2907) bd->alloc = 4;
> efb0e3a0 2908) bd->nr = 0;
> efb0e3a0 2909) ALLOC_ARRAY(bd->keys, bd->alloc);
> efb0e3a0 2911) add_bloom_key(bd, path);
> efb0e3a0 2913) sb->bloom_data = bd;
> efb0e3a0 2920) for (i = 0; i < sb->bloom_data->nr; i++) {
> efb0e3a0 2921) free(sb->bloom_data->keys[i]->hashes);
> efb0e3a0 2922) free(sb->bloom_data->keys[i]);
> efb0e3a0 2924) free(sb->bloom_data->keys);
> efb0e3a0 2925) FREE_AND_NULL(sb->bloom_data);
> efb0e3a0 2927) trace2_data_intmax("blame", sb->repo,
> efb0e3a0 2929) trace2_data_intmax("blame", sb->repo,

For this to be covered, I need to modify my build to use GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS=1. I'll have that ready for the next run.

> Derrick Stolee	72ca4f9b commit: write commit-graph with Bloom filters
> commit-graph.c
> 72ca4f9b 1979) ctx->changed_paths = 1;
Same here, although I will change this line in the next version.
 
Thanks,
-Stolee
Previous: Derrick StoleeNext: Taylor Blau
Message 2 of 3 in “Git Test Coverage Report (April 16, 2020)”
  1. Derrick StoleeApr 16, 2020
  2. Derrick StoleeApr 16, 2020
  3. Taylor BlauApr 16, 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.