From: Jeff King Date: Fri, 01 Jul 2022 18:21:50 GMT Subject: Re: How to reduce pickaxe times for a particular repo? Message-ID: In-Reply-To: <6439e948-ff79-9e10-97f5-378806e25b5b@github.com> 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 or -G to see which commits change the > number of matches of that or . 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