-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use gitstatus #336
Comments
I like the idea in general, but it's obviously depending on a platform-specific binary being present on the system and the I believe that these requirements run counter to the idea of just downloading/sourcing a single However I could see this as either:
The second variant might require the |
@Konfekt until there is a decision for this, https://github.com/romkatv/powerlevel10k comes packaged with gitstatusd, the install instructions here https://github.com/bhilburn/powerlevel9k/wiki/Install-Instructions#option-9-install-for-zim should work when edited correspondingly, if it does you just have to disable zims git plugins and maybe rebuild cache. Working well for me. |
@PatTheMav I would probably vote for an optional, documented module- using a fallback might introduce confusion about different speeds between users / systems / setups. |
Thanks for looping me in. gitstatus has zsh bindings that just work. It can be installed and used like a regular zsh plugin. The fact that heavy lifting is done by a native binary is an implementation detail. git clone https://github.com/romkatv/gitstatus.git ~/gitstatus
source ~/gitstatus/gitstatus.plugin.zsh (It also works with all popular plugin managers.) If you want to use gitstatus in your code only if the user has installed it, you can do the following.
Here's an example: gitstatus_start MY
gitstatus_query MY
set | egrep '^VCS_STATUS' When I run it while in VCS_STATUS_ACTION=''
VCS_STATUS_ALL=( /home/romka/.oh-my-zsh/custom/themes/powerlevel10k 1d7c63f80fcc1ea1b79342c972fe77e3e2ec80e4 master master origin git@github.com:romkatv/powerlevel10k.git '' 0 0 0 0 0 0 '' )
VCS_STATUS_COMMIT=1d7c63f80fcc1ea1b79342c972fe77e3e2ec80e4
VCS_STATUS_COMMITS_AHEAD=0
VCS_STATUS_COMMITS_BEHIND=0
VCS_STATUS_HAS_STAGED=0
VCS_STATUS_HAS_UNSTAGED=0
VCS_STATUS_HAS_UNTRACKED=0
VCS_STATUS_LOCAL_BRANCH=master
VCS_STATUS_REMOTE_BRANCH=master
VCS_STATUS_REMOTE_NAME=origin
VCS_STATUS_REMOTE_URL=git@github.com:romkatv/powerlevel10k.git
VCS_STATUS_RESULT=ok-sync
VCS_STATUS_STASHES=0
VCS_STATUS_TAG=''
VCS_STATUS_WORKDIR=/home/romka/.oh-my-zsh/custom/themes/powerlevel10k You can also call See high level docs at https://github.com/romkatv/gitstatus and details at https://github.com/romkatv/gitstatus/blob/master/gitstatus.plugin.zsh. You can also read the code of Powerlevel10k to see how it integrates with gitstatus, although it's kinda brutal. Ping me if you have any questions. |
@romkatv I think one of the issues is that |
@lnicola Could you give me a link to the popular |
@romkatv In essence, git-info stores its data in While gitstatus can be patched into a |
@lnicola Thanks for the links. I believe the only ZSH API for querying git status that deserves adjective "popular" is vcs_info. Everything else, including my gitstatus, is marginal. Integrating gitstatusd right into Writing a wrapper over gitstatus to emulate another API isn't too difficult. I've done exactly this in Powerlevel10k. This theme can generate the same prompt by using either gitstatus or vcs_info. The API here is made of configuration options supported by the theme, and there are two implementations of it. It did help that I could easily add extra features to the daemon whenever I needed them, which may not be something you can do. But if you open an issue explaining what's missing for your use case, or send a PR, we can get it done. |
Sounds cool. Just to be clear, I'm not volunteering to do this. If anyone else wants to give it a shot, I can promise to provide high-quality support from gitstatus side of things. |
@romkatv Sure, no worries. Also none of us are the authority on this, that'd be @ericbn or @Eriner 😁 (Even though anybody can write a I don't think it's impossible to write such a plugin (which would populate |
I like @p1g30n's idea o having a separate gitstatus-git-info module instead of updating the current git-info to use gitstatus as a fallback. Just not sure if we should have gitstatus as a submodule of gitstatus-git-info. This would definitely not make sense in the bleeding-edge develop branch of Zim. I started to work on this, and PRs are welcome too. |
Since this is supposed to be a fast framework for zsh, including the git status prompt, using gitstatus by https://github.com/romkatv/gitstatus instead of
git status
to speed up the prompt git status display seems pertinent.The text was updated successfully, but these errors were encountered: