henrikruscon / hyper-statusline

Status Line Plugin for Hyper
MIT License
387 stars 79 forks source link

Menu to change git branch #13

Closed caesar closed 7 years ago

caesar commented 7 years ago

A potential feature idea… It occurred to me that clicking the name of the current branch could open a menu with a list of other existing branches, which could be switched to by clicking on them.

What do you think? May be quite a big job to implement (I haven't really thought yet about how it would be implemented…)

caesar commented 7 years ago

And sorry for three issues in quick succession, I'll leave off it for a bit now… :-D

henrikruscon commented 7 years ago

@caesar I like the idea but what would happen with the current feature that opens git remote if one exists?

Instead of fetching the current branch you could fetch existing branches. Most of the work would be spent on the UI part.

caesar commented 7 years ago

Interesting, I hadn’t realised it was meant to open the git remote. Doesn’t seem to do anything for me even for repos I know have remotes (such as this one).

Yes I guess most of the work would be planning and executing the UI, it’s a project for when you have a bit of spare time (or I do)...

henrikruscon commented 7 years ago

Does your remotes contain https? If they do, would you mind sharing the strings so that I can debug? It's only meant to open remotes with https.

caesar commented 7 years ago

Ah that's why. The remotes I was looking at are ssh ones as are most of my remotes - eg git@github.com:henrikdahl/hyper-statusline.git. I guess there's not much you can do to link those, without some 'magic' (ie, builtin support for GitHub and other common remotes).

borwahs commented 7 years ago

@henrikdahl & @caesar -

I actually implemented a rough version of this feature a while back.

I happened to work on it (unknowingly that this request was here) a bit around the same time but got busy with another project and never posted anything.

Here is what it currently looks like if you click the branch name:

screen shot 2017-03-16 at 12 40 09 am

The list only shows local branches (so they must be tracked). As mentioned above, the downside to this feature is it removes the current behavior which opens the remote.

@henrikdahl - let me know if you would be interested in me opening a PR so we could play around with it to see if it fits with the plugin or not.

ELLIOTTCABLE commented 6 years ago

@borwahs this looks amazing! Would certainly be nice and simple for new Git users, I'd love to be able to heartily suggest this!


On a related note, though, as much as I love it … this seems a bit ‘heavy’ to be in hyper-statusline itself.

Given that “a status line” is such a thing of taste, and has so much powerful promise (Look at the number of ‘modules’ for things like Powerline or Powerlevel-9k!), I think maybe there needs to be a discussion of ‘opening up’ this module? I'd rather see @borwahs' work, for example, as san hyper-statusline-change-git-branch module.

Maybe this needs a new Issue, but more than anything else, what I want out of a status-bar — rather than any particular feature — is asynchrony. (That is, the ability to stuff it full of a dozen bajillion heavy status-icons if I really want to, without the ‘slow ones’ preventing the snappy display of the ‘fast ones’ when I change directories or open a new tab.) Perhaps this project is a good place for a central framework for writing status-modules, as opposed to the implementations thereof themselves?

Just my 2¢, and possibly a horrible pile of premature optimization, hah!