-
Notifications
You must be signed in to change notification settings - Fork 743
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
Add git_stash segment to display number of stashes, if any #201
Conversation
👍 Just tested this out and it looks good. One suggestion: add spaces on either side of the stash count text to match the style of other segments (last 2 prompts in screenshot). |
Sure, if you think it looks better. I removed them to stop the segment being too wide, but I guess we could lose the parentheses instead. Perhaps spaces on either side but with a trailing 's' or asterisk to denote that it's stashes rather than commits ahead/behind (which is why I parenthesised it in the first place). |
|
||
|
||
def add_git_stash_segment(): | ||
stash_count = subprocess.check_output('git stash list | wc -l', shell=True).strip() |
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.
Doing the line count in Python may be more efficient. Would be interested in seeing if that were true.
A few new icons were added in #136. I wonder if we should add a new one for this as well rather than the parentheses. The asterisk no longer will work since that is being used to denote conflicts. Another change that could make this align with #136 would be to show only the icon when there is one stash and a number with the icon when there is more than one stash. |
I'll have a look at reworking this in light of the changes in #136. I think I'll close this and open a new pull request once it's done. |
I have had a quick glance at some potential unicode glyphs to represent stashes: I'm leaning towards \u2295 (circled plus). If you have something better in mind, let me know. |
Agreed that the S is too big. The next/previous page are also my favorite of these. |
I don't, really. What you came up with looks fine. I think once I'm using it, maybe I'll have more of an opinion. |
Did there ever happen any pull request regarding this issue? Would be happy to have this feature... Really forget my stashes all the time -.- |
Nope, I totally forgot about this (but shamefully have been using it myself for the past 2.5 years) The segment code looks to have changed a little since I wrote this, so I'll redo it in the updated style and submit a PR soon (I promise ;)) |
@b-ryan would your preference be for this to be a new segment (as suggested in the original issue, #114) or to be added to the existing git segment? Ultimately all this does is call |
@apinkney97 The I never got around to looking into using something like pygit to do these git lookups in the same process. |
Ok, I'll probably add it as a new |
Agreed with @phatblat :) |
Addresses issue #114