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

Re: [PATCH 0/8] Introduce git-blame-tree(1) command

From
Jeff King <peff@peff.net>
Date
Apr 1, 2025, 09:29 UTC
Message-ID
<20250401092952.GD21089@coredump.intra.peff.net>
In-Reply-To
<Z+XJ+1L3PnC9Dyba@nand.local>
On Thu, Mar 27, 2025 at 05:58:19PM -0400, Taylor Blau wrote:
Show 19 quoted lines
> On Thu, Mar 27, 2025 at 02:32:43AM -0400, Jeff King wrote:
> > The pathspec-trie stuff is, I think, still a reasonable idea for general
> > use. But IIRC, the rewritten blame-tree you guys worked on does not
> > benefit from it, because it ditches pathspecs entirely (both because
> > they're too slow without the tries, but also because it's important to
> > continually narrow the pathspec while traversing). That trie code was
> > never run in production, I think (and I see there is a patch to narrow
> > the pathspec while traversing; I suspect that likewise was never used).
> 
> Yeah, the rewritten blame-tree code uses changed-path Bloom filters to
> narrow the set of revisions that we need to actually compute tree-diffs
> for.
> 
> The general idea is that we have a set of paths that we have yet to
> blame, and those are the "interesting" ones. IOW, if a changed-path
> Bloom filter tells us that we are at some revision where there is maybe
> a change to one or more unblamed paths, we need to compute a tree-diff.
> But if the Bloom filter says "no", then we can skip the tree-diff at
> that layer entirely.

You'd still in theory benefit from the tree-diffs you _do_ run using a continually narrowing pathspec. Skimming over the code from your tb/blame-tree branch, it looks like it's just fed the original pathspec. But that's probably good enough in practice. Especially for non-recursive blame-trees, where pruning already-matched entries will never save you from opening another tree anyway.

Show 8 quoted lines
> > So yeah. I don't know if all of this is really a very good starting
> > point. Taylor, if you can share the current code that GitHub is running,
> > I think that would be beneficial for the community.
> 
> Sure. You can fetch from the 'tb/blame-tree' branch from my tree (which
> is located at 'git@github.com:ttaylorr/git.git'). I owe a huge "thank
> you" to Victoria Dye, who split out the various topics from GitHub's
> fork into individual rebased branches.

Thanks. I don't have time to pick it up as a topic myself, but hopefully it can be useful to Toon (or any others interested in the topic).

-Peff
Previous: Toon ClaesNext: Derrick Stolee
Message 14 of 15 in “Introduce git-blame-tree(1) command”
  1. 0/8 Introduce git-blame-tree(1) commandToon Claes, Mar 26, 2025
  2. 1/8 combine-diff: zero memory used for callback filepairsToon Claes, Mar 26, 2025
  3. 2/8 within_depth: fix return for empty pathToon Claes, Mar 26, 2025
  4. 3/8 diff: teach tree-diff a max-depth parameterToon Claes, Mar 26, 2025
  5. 4/8 blame-tree: introduce new subcommand to blame filesToon Claes, Mar 26, 2025
  6. 5/8 pathspec: add optional trie indexToon Claes, Mar 26, 2025
  7. 6/8 pathspec: turn on tries when appropriateToon Claes, Mar 26, 2025
  8. 7/8 tree-diff: use pathspec triesToon Claes, Mar 26, 2025
  9. 8/8 blame-tree: narrow pathspec as we traverseToon Claes, Mar 26, 2025
  10. Taylor BlauMar 26, 2025
  11. Jeff KingMar 27, 2025
  12. Taylor BlauMar 27, 2025
  13. Toon ClaesMar 28, 2025
  14. Jeff KingApr 1, 2025
  15. Derrick StoleeMar 27, 2025

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.