Comments (6)
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.
@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.
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
.
Here is the setGitStatus
function where the cache might be implemented:
Will dig further into the codebase to see what can be done and maybe put out a PR.
from oh-my-posh.
@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.
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.
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)
- Difference between JSON themes schema and documentation HOT 1
- New segment request: Talosctl current context HOT 6
- shell config error
- When using nushell with --no-history I get error on oh-my-posh.nu HOT 8
- Long command from history disappears during attempt to modification (for slimfat theme)
- Display keyboard and/or mouse battery status HOT 8
- Weird escape characters on the VSCode integrated Terminal HOT 14
- git {{ .BranchStatus }} reports as ≢ even with upstream
- Disabling update checks from the configuration file
- Color is not rendered randomly HOT 1
- Unexpected error icon on WSL startup HOT 1
- Python segment should check for the `py` launcher on Windows and display the version it runs HOT 1
- VS Code terminal displays ANSI escape sequence characters HOT 3
- More full-featured matching for `mapped_locations` for paths
- Support to the new version of Cascadia (2404.23)
- Extra space at the end of the right prompt HOT 3
- shell_integration causes Enter to sometimes not echo with slow commands HOT 1
- When shell_integration is set to true a key needs to be pressed before prompt is shown in Windows Terminal Preview in powershell HOT 2
- Open new pane in Windows Terminal is not following current working directory as expected HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oh-my-posh.