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

Re: git log exclude pathspec from file - supported? plans?

From
Jeff King <peff@peff.net>
Date
Jul 1, 2021, 21:43 UTC
Message-ID
<YN42+1dN8bML3tQ8@coredump.intra.peff.net>
In-Reply-To
<YN4zKVK7gvuIZ0vK@coredump.intra.peff.net>
On Thu, Jul 01, 2021 at 05:27:05PM -0400, Jeff King wrote:
Show 7 quoted lines
> > One of the PCREv2 experiments I had very early WIP work towards was to
> > create a search index for commit messages, contents etc. and stick it in
> > something similar to the --changed-paths part of the commit-graph.
> 
> Yeah, to some degree --change-paths may mitigate this, since for a
> series of simple pathspecs we'd generate the bloom filter once and then
> get O(1) matching per commit.

The timings for "git rev-list" I shared earlier were with commit-graphs, but not with changed-path filters. They don't seem to help much, though.

I suspect the reason is that they can never give a definite answer. They can only say "probably, yes, this commit is worth looking at". And then we have to do the same slow, linear pathspec match on that commit. And if your pathspec contains virtually every path in the first place, then the answer from the bloom filters will always be "probably, yes".

So I guess they are not really a silver bullet here.
-Peff
Previous: Jeff King
Message 8 of 8 in “git log exclude pathspec from file - supported? plans?”
  1. Martin LanghoffJun 30, 2021
  2. Jeff KingJun 30, 2021
  3. Ævar Arnfjörð BjarmasonJun 30, 2021
  4. Jeff KingJul 1, 2021
  5. 1/3 pathspec: add optional trie indexJeff King, Jul 1, 2021
  6. 2/3 pathspec: turn on tries when appropriateJeff King, Jul 1, 2021
  7. 3/3 tree-diff: use pathspec triesJeff King, Jul 1, 2021
  8. Jeff KingJul 1, 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.