hydro icon indicating copy to clipboard operation
hydro copied to clipboard

Add git stash indicator with count (when greater than 1)

Open ankurkotwal opened this issue 3 years ago • 4 comments

Adds a git stash indicator when a stash is present. If there are more than 1 stashes present, it will also include a count.

ankurkotwal avatar Mar 15 '23 01:03 ankurkotwal

@jorgebucaran Could I bump this PR please?

ankurkotwal avatar Mar 21 '23 06:03 ankurkotwal

Hi @ankurkotwal, sorry for the delayed response. I appreciate your contribution, but I have some concerns regarding the impact of this change on performance. Have you tested it thoroughly? I noticed that there's no option flag to hide or show the stash either, so this would show by default whenever there's anything in the stash. Do you think it's possible to add this as an option to enhance the user experience?

I was also curious about how often do you use git stash at all? I never use it, but that's just me.

jorgebucaran avatar Mar 21 '23 06:03 jorgebucaran

Thanks for the reply @jorgebucaran. I have tested it with the repos that I use, which are admittedly not that large. I would expect that there isn't a huge performance penalty since we're counting stashes only - these don't scan through directories, just the index.

I can add a feature flag to hide/show this. How would you like it to function? Enable/disable the indicator altogether or just the count or a setting for each? Most other prompts I've used tend to show a stash indicator so I propose always showing the indicator (when one or more stashes are present) but having a feature flag for showing the count. Would you be happy with that?

I use git stash semi-regularly and do find this useful. Usually its when I'm working on changes and need to pull the repo before committing. I'll stash my changes, pull the repo, reapply the stash and resolve the conflicts (if any) - I prefer this to having a commit for the change and another for the merge. Hope that helps.

ankurkotwal avatar Mar 30 '23 01:03 ankurkotwal

I can add a feature flag to hide/show this. How would you like it to function? Enable/disable the indicator altogether or just the count or a setting for each? Most other prompts I've used tend to show a stash indicator so I propose always showing the indicator (when one or more stashes are present) but having a feature flag for showing the count. Would you be happy with that?

I went ahead and made the stash indicator show by default but only show the count if the variable is set. Feedback welcome.

ankurkotwal avatar Mar 31 '23 11:03 ankurkotwal