On Tue, Jun 28, 2022 at 09:01:17AM -0400, Derrick Stolee wrote: > > Typically, a `git log -S/-G` lookup takes around a minute to complete. > > I would like to significantly reduce that time. How can I do that? I > > can spend up to 10x more disk space, if required. The machine has 10 > > cores and 32GB of RAM. > > You are using -S<string> or -G<regex> to see which commits change the > number of matches of that <string> or <regex>. If you don't provide a > pathspec, then Git will search every changed file, including those > very large binary files. > > Perhaps you'd like to start by providing a pathspec that limits the > search to only the meaningful code files? I think "-S" will search every file, since it's just counting instances of the token in each file. But "-G" does a diff first, so it skips binary files. So you could probably speed it up in general with a .gitattributes that mark large binary files as such. Sort of the same concept as your pathspec suggestion (which is a good one), but you don't have to remember to add it to each invocation. :) -Peff