How does fugitive integrate with projectionist? #1866
-
I have a bit of backstory here. A few months ago I noticed that fugitive buffers were taking longer and longer to open. Turned out that the size of our repo was rapidly growing. But why was that a problem for Fugitive? I did some profiling and noticed that the vast majority of the time was being spent in one of two for-loops inside the
Being naive and inexperienced with fugitive's code, I figured I'd tackle the problem right there in that function. I noticed that the "lines" being iterated came from the output of This actually worked. All fugitive buffers opened nice and quickly again. I left the change sitting in my local checkout for a few months, and never encountered a problem. Cut to today, when I thought "okay maybe it's time to open a PR". I figured this was a higher bar than just whatever hacky nonsense I did for myself, and so I should really know exactly what's going on here. My first question: how often is Turns out, the only calls were looking for the I also noticed that it was possible to turn off projectionist-fugitive integration by doing Now my questions, since this piqued my curiousity!
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
To use Projectionist features inside Fugitive buffers. For example, you can
A few like rails.vim, rake.vim, and bundler.vim use it in basically the same way. Scriptease allows you to This is hard to grep for so there's probably a couple of others I'm missing.
They're undocumented because I didn't want to bloat out the documentation with the multi-paragraph explanation they would need without knowing if there were actual users out there that would need them. They are safe to rely on. I would start with
The result is cached at the repository level, so any fix would need to update the granularity of the cache as well. I didn't do it this way because for small repos, having one big call to And yeah, we would need a different approach for Given the effort needed to diagnose the problem, I think fixing this is high value and worthy of prioritization. A good first step would be to implement this in if empty(path)
let entry = [ftime, '040000', 'tree', '', -1]
elseif commit =~# '^[0-3]$'
" TODO
else
let [tree, ftime] = s:TreeInfo(dir, commit)
let entry = get(tree, path, [])
endif |
Beta Was this translation helpful? Give feedback.
To use Projectionist features inside Fugitive buffers. For example, you can
:Gedit HEAD:file.c
and then call:A
to get toHEAD:file.h
.A few like rails.vim, rake.vim, and bundler.vim use it in basically the same way. Scriptease allows you to
:source
Fugitive buffers. Eunuch uses it to enable several operations on Fugitive buffers. For example, if you:Gdiffsplit
and:Delete
, that effectively does agit rm --cached
.This is hard to g…