Skip to content
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

Merged
merged 3 commits into from
Apr 13, 2020
Merged

Conversation

camsteffen
Copy link
Contributor

Fixes #532.

I removed the %m action from vcs_info and instead just added another async task. The %m seems to include extra, unneeded functionality.

Copy link
Collaborator

@mafredri mafredri left a 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 😄.

pure.zsh Outdated Show resolved Hide resolved
@@ -365,6 +352,10 @@ prompt_pure_async_git_arrows() {
command git rev-list --left-right --count HEAD...@'{u}'
}

prompt_pure_async_git_stash() {
Copy link
Collaborator

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.

Copy link
Contributor Author

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
Copy link
Collaborator

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?

Copy link
Contributor Author

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

pure.zsh Outdated Show resolved Hide resolved
Copy link
Collaborator

@mafredri mafredri left a 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.

pure.zsh Outdated Show resolved Hide resolved
Co-Authored-By: Mathias Fredriksson <mafredri@gmail.com>
@mafredri mafredri merged commit 7f1e473 into sindresorhus:master Apr 13, 2020
@camsteffen camsteffen deleted the fix-stash branch April 13, 2020 14:00
sileht pushed a commit to sileht/pure that referenced this pull request Apr 18, 2020
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
wezzynl added a commit to wezzynl/pure that referenced this pull request May 1, 2020
* 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)
wezzynl added a commit to wezzynl/pure that referenced this pull request Sep 28, 2020
…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)
kutsan pushed a commit to kutsan/pure that referenced this pull request Jun 19, 2023
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Git stash shows during git action
3 participants