You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
there's an opportunity to pack even more stuff into the git rev-parse command: e.g. in pkg/app/app.go we call VerifyInGitRepo which does git rev-parse --git-dir and IsBareRepo which does git rev-parse --is-bare-repository.
This is a follow-on issue to track the opportunity to further consolidate lazygit's info retrieval from git rev-parse. During #3183, Jesse observed that rev-parse can take multiple arguments and return the requested information on a line-by-line basis, which reduces overhead vs. multiple git invocations.
See GetRepoPaths() in pkg/commands/git_commands/repo_paths.go for the new centralized invocation of git rev-parse (on the #3183 branch, or on master once that's been merged.)
The text was updated successfully, but these errors were encountered:
Thanks for making this issue @jwhitley . To clarify: the goal here is to reduce lazygit startup time as much as possible by reducing the number of git calls required (each git call takes ~10ms on my machine). Given that git rev-parse can take multiple arguments and return multiple values in one go, we want to try and have all the git rev-parse calls on startup condensed into a single call
FWIW, I think it's also possible to consolidate VerifyInGitRepo(), which is another git rev-parse --git-dir call. The idea would be to just call GetRepoPaths() and either 1) return the error if not in a git repo or 2) cache the path results that much earlier. The real question there is the dataflow/architectural impact of doing that. I'll have a look at that, and see what might be done.
In #3183, @jesseduffield writes:
This is a follow-on issue to track the opportunity to further consolidate lazygit's info retrieval from git rev-parse. During #3183, Jesse observed that rev-parse can take multiple arguments and return the requested information on a line-by-line basis, which reduces overhead vs. multiple git invocations.
See
GetRepoPaths()
inpkg/commands/git_commands/repo_paths.go
for the new centralized invocation of git rev-parse (on the #3183 branch, or onmaster
once that's been merged.)The text was updated successfully, but these errors were encountered: