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

git stash #365

Closed
jpresley23 opened this issue Nov 13, 2017 · 8 comments
Closed

git stash #365

jpresley23 opened this issue Nov 13, 2017 · 8 comments

Comments

@jpresley23
Copy link

I read the discussion in Issue #317 and understand the concern to not have a messy prompt. The right prompt suggestion is a decent workaround but the problem is that shows a message when there are no changes in stash. For a light user of stash, the constant 0 in the right hand side of the screen is a distraction. Changing that requires building a function that indicates it may be more appropriate.

I use stash to store work in progress changes that I don't want to commit before I re-integrate master into my branch. It's useful to see an indicator if there are changes in stash I forgot about if I get interrupted in my workflow. I used a custom prompt that someone at work shared around that used something like * to indicate there is something in your stash.

Would it be a good compromise to add the stash indicator functionality but set a default minimum threshold before there is an indicator that could be changed with an environment variable? For example, the default could be a high number, say. Those who are light stash users could override that and set it to 0.

The alternative is to create a super light "pure-stash" indicator that is separate from pure.

@jpresley23
Copy link
Author

@leoj3n I'm curious on your thoughts since you opened the original issue.

@henrywallace
Copy link

Alternatively, is it possible to allow calling some custom function for displaying git information? Where I still want to use the rest of pure prompt, but insert my own git information.

@carhartl
Copy link
Contributor

carhartl commented Feb 8, 2019

I'd love to see support for stashes... at the moment I've hacked something into prompt_pure_preprompt_render() on my own machine, the result looking like:

screenshot 2019-02-08 at 19 05 37

If there are any stashes, the yellow ≡ icon is shown, otherwise not... (similar to how in and outgoing arrows behave)

(I would be happy to prepare a PR for this.)

PS: Icon and color is inspired by https://github.com/michaeldfallen/git-radar, which I recently migrated from to pure...

@carhartl
Copy link
Contributor

carhartl commented Feb 9, 2019

Might be even nicer to have the icon the same color as the arrows, though I'm not a designer :)

@carhartl
Copy link
Contributor

Here's the implementation: master...carhartl:git-stash-support

It would need some polishing I guess, making the icon configurable (similar to the arrows) and so on.

@joeytwiddle
Copy link

joeytwiddle commented Jun 23, 2019

For what it's worth, in my version of git-aware-prompt I only show the stash indicator if the top stash was made on the current branch (or on the current commit).

That suits my workflow, because it doesn't distract me when I am working on a different branch, but when I switch back to the branch where I originally stashed, the indicator appears, reminding me I need to pop. To reduce clutter, you may consider implementing the feature that way. Code is here but not beautiful!

@fauust
Copy link
Contributor

fauust commented Sep 10, 2019

I read the discussion in Issue #317 and understand the concern to not have a messy prompt. The right prompt suggestion is a decent workaround but the problem is that shows a message when there are no changes in stash. For a light user of stash, the constant 0 in the right hand side of the screen is a distraction. Changing that requires building a function that indicates it may be more appropriate.

See #317 (comment) for a Q&D hack.

@sindresorhus
Copy link
Owner

Fixed by #462.

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

No branches or pull requests

6 participants