-
-
Notifications
You must be signed in to change notification settings - Fork 971
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
Fix stash during git action #535
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this. It's a solid approach, just a few comments 😄.
@@ -365,6 +352,10 @@ prompt_pure_async_git_arrows() { | |||
command git rev-list --left-right --count HEAD...@'{u}' | |||
} | |||
|
|||
prompt_pure_async_git_stash() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really requesting a change here as I don't mind doing this as an extra async task, but it should be quite a lightweight command and there could be a little bit of extra overhead in doing this as a separate async task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe. Making it async seems like a safer bet.
@@ -447,6 +436,11 @@ prompt_pure_async_refresh() { | |||
# Check check if there is anything to pull. | |||
async_job "prompt_pure" prompt_pure_async_git_dirty ${PURE_GIT_UNTRACKED_DIRTY:-1} | |||
fi | |||
|
|||
# If stash is enabled, tell async worker to count stashes | |||
if zstyle -t ":prompt:pure:git:stash" show; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this doesn't support removing the stash symbol if the user sets it to false after it has been enabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. I'll add else unset prompt_pure_git_stash
213d042
to
bee95b6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great @camsteffen, thanks! We need to incorporate the fix for implicit global variable but other than that, this is great.
Co-Authored-By: Mathias Fredriksson <mafredri@gmail.com>
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com> Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
* upstream/master: 1.12.0 Respawn Pure async worker on crash (sindresorhus#543) Use HTTPS links Fix stash during git action (sindresorhus#535) Move Git action after dirty with space and default color (sindresorhus#506)
…ster * 'master' of https://github.com/sindresorhus/pure: 1.14.0 More system report improvements (sindresorhus#568) Use GIT_OPTIONAL_LOCKS=0 instead of --no-optional-locks (sindresorhus#569) Show user@host when running in a container (sindresorhus#564) Update zsh-async to v1.8.4 (sindresorhus#566) Add zsh-async version to system report (sindresorhus#567) Bump Pure internal version when publishing package (sindresorhus#565) Update readme.md 1.13.0 Respect Git config `status.showUntrackedFiles` (sindresorhus#542) Add forivall/pure to Ports section in the readme (sindresorhus#556) Fix '--no-optional-locks' argument position (sindresorhus#553) Eliminate unnecessary Git locking (sindresorhus#549) Readme tweaks 1.12.0 Respawn Pure async worker on crash (sindresorhus#543) Use HTTPS links Fix stash during git action (sindresorhus#535) Move Git action after dirty with space and default color (sindresorhus#506)
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com> Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
Fixes #532.
I removed the
%m
action fromvcs_info
and instead just added another async task. The%m
seems to include extra, unneeded functionality.