Python-based fetch optimizer script for "blame" in Partial Clones (was: Re: Sensible way to see what objects are being fetched just-in-time in a partial clone?)
- From
Tao Klerks <tao@klerks.biz>
- Date
- Aug 26, 2024, 20:37 UTC
- Message-ID
- <CAPMMpojae7t1Z0PQPf=d2WzzbaMwkhvo34b_sxdtUQxvDu4fJw@mail.gmail.com>
- In-Reply-To
- <CAPMMpoiPeSyLHUd072Q9AozdaCAjpOL03jY-0Y33B2iEQ5EdTQ@mail.gmail.com>
On Mon, Aug 26, 2024 at 9:37 PM Tao Klerks <tao@klerks.biz> wrote:
Show 15 quoted lines
> > On Mon, Aug 26, 2024 at 7:28 PM Junio C Hamano <gitster@pobox.com> wrote: > > > > > > Unlike the diff machinery, blame does not have a prefetch machinery. > > I am glad that somebody is looking at it. > > I will try to "productize" it sufficiently to send here in case it's > useful to someone, but all I can really offer the community-at-large > is confirmation that in principle, the approach works as you would > expect: With some small number of jit-fetches for rename-detection > during the revision walk(s), and with one blob-prefetch call > afterwards, "git blame" can be made to run cleanly/quickly in a > "filter:none" clone even on a file like "git.c", with hundreds of > revisions.
FWIW, here is the script I ended up with, which seems to work reliably for me (through renames etc). Obviously I'd love to see this built into "git blame" itself, but this wrapper might help someone out there in the meantime.