Giter Site home page Giter Site logo

Comments (6)

JanDeDobbeleer avatar JanDeDobbeleer commented on May 25, 2024 2

Go git is terribly slow, tried it before. I don't mind adding support for existing cache tools, I'm not in favor of adding logic that aims to do what git itself should improve (faster status).

from oh-my-posh.

JanDeDobbeleer avatar JanDeDobbeleer commented on May 25, 2024 2

@brian6932 check, but as a maintainer, I need to be careful how far this can get pushed. And that's an implementation where I want to be in the lead so I can also keep offering support. It's not easy or straightforward or git would've fixed it already.

from oh-my-posh.

ivan-the-terrible avatar ivan-the-terrible commented on May 25, 2024 1

Currently doing some reading about this. I like the note that's here on romkatv gitstatus README's Why Fast. This does make a lot of sense and I might seek to replicate the scenario used in the benchmarks.

I also understand the idea behind the PRs you listed from posh-git PR 924 using Get-GitConciseStatusFromCache (which is defined here).

There is a oh-my-posh does have a cache declared within the JSON file at AppData\Local\oh-my-posh\omp.cache.
image

Here is the setGitStatus function where the cache might be implemented:

image

Will dig further into the codebase to see what can be done and maybe put out a PR.

from oh-my-posh.

ivan-the-terrible avatar ivan-the-terrible commented on May 25, 2024

@brian6932 what would be really cool is if there is a Go package available with the logic :)
If you could poke around to find one, that would be extremely helpful.

from oh-my-posh.

brian6932 avatar brian6932 commented on May 25, 2024

There's https://github.com/go-git/go-git I guess, you'd have to implement the caching on top of it, or just use the code from https://github.com/go-git/go-git/blob/master/status.go and work from there, as it'd reduce dependencies.

from oh-my-posh.

brian6932 avatar brian6932 commented on May 25, 2024

I found starship (which uses gitoxide) to have a relatively performant git status prompt (https://github.com/mcwarman/starship/tree/feature/detailed-github-status), only thing's that submodules have to be disabled ([git_status] ignore_submodules = true), or else it becomes extremely slow, so it's definitely not impossible to parse git status from .git quicker.

from oh-my-posh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.