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

Prefix all available commands with GitSavvy for discoverability #1756

Open
gerardroche opened this issue May 23, 2023 · 5 comments
Open

Prefix all available commands with GitSavvy for discoverability #1756

gerardroche opened this issue May 23, 2023 · 5 comments

Comments

@gerardroche
Copy link

Some commands are prefixed "github:" e.g. github: open file on remote. I want to suggest prefixing all available commands with **GitSavvy: * for discoverability.

braver just made me aware of the command github: open file on remote. I had no idea it existed. I would have know if the command was prefixed "GitSavvy" because to see what commands were available that's what I checked.

@braver
Copy link

braver commented May 23, 2023

Semi-related, I use GitLab for work and github: open file on remote also works for GitLab repo's... I would also think that you'd be able to figure out what service to use based on the remote url. So maybe change it to simply "GitSavvy: open file on remote"?

@kaste
Copy link
Collaborator

kaste commented May 23, 2023

Hello! I have reservations about prefixing all commands with GitSavvy:. There are a couple of reasons for this. Firstly, it would be a major and disruptive change. Secondly, we currently follow the format that users would typically type on the Terminal. E.g. we use git: rebase --abort (even instead of git: abort rebase) for certain commands. I think, I favor this command-like structure over a natural language style description.

Regarding the hub commands, they have their own prefixes, namely github: and gitlab:. Although I wasn't here at that time, it's evident that we don't have any code yet to (correctly) determine the hub service based on a remote URL. As a result, we can't consider options like gitsavvy: open file/issue on remote, nor can we simply rename the command descriptions.

Interestingly, we don't share any code between the integrations for GitLab, GitHub, and Bitbucket.

@gerardroche
Copy link
Author

gerardroche commented May 23, 2023

I wouldn't have thought it would be very much disruptive because of fuzzy search in the command palette. Users typing github: ... should generally still get the same command. I was thinking something more like gitsavvy: github: open file/issue on remote to avoid that exact issue. Ideally it would probably be more like gitsavvy: open github file/issue on remote or gitsavvy: open file/issue on github, but I'd go with the former to avoid the disruption issue i.e. users type gh: ... should still get the same command as before.

@kaste
Copy link
Collaborator

kaste commented May 24, 2023

Okay, I generally dislike the double prefix gitsavvy: github: . Then: gitsavvy: open github file on remote probably doesn't make much sense. I never understood "Open file on remote" anyway (but learned to deal with it) as it is "open file in browser" actually. I do like open file on github of course because it is the better description in all regards.

But although I like the natural language style, "abort merge", "continue rebase", "open file on github", we typically use the reversed style in GitSavvy. (We do github: create pull request, you suggest Create pull request on GitHub.) This reversed style leads to some grouping like

image

So a "pull with rebase" is clearly not a "rebase" action.

The prefix GitSavvy is currently reserved for internal commands. Typically users don't need them (except the Preferences).

image

Then we "register" also git: and the hub stuff. E.g. for GitHub:

image

I would like to get more input because in general I really like the prefix style esp. for discoverability. What can I do with "github", just type github: . (Of course we don't mention this style in the README 🙄.) Also in this list only "open file on remote" is completely misleading as "remote" typically refers to a local configuration thing. For example: "add fork as remote" is somewhat correct as the users chooses one of the forks hosted on github and adds it to the local configuration. "open file in the browser", "open file on the web".

image

@gerardroche
Copy link
Author

Yes. Now I know there are also some commands prefixed "git: ". I like to be able to see what package a command belongs to, which is why I like packages to prefix all their commands with the name of their package.

Perhaps there is a Sublime Text Command Palette feature in there somewhere e.g. the Command Palette prefixes all the commands with the package name, something like how it suffixes the key binding. For backwards compatibility it could strip out any existing prefix so it's not duplicated.

The "github: " prefix seems a bit clunky to me. All of those commands would apply to gitlab, bitbucket, etc. and if that's not a feature I have to assume it will be so "git: " makes sense me even if those services are not supported yet.

All the commands are lowercase too, which seems at odds to the general format of the Command Palette. Perhaps Sublime Text should provide a best practice guide for naming conventions to encourage consistency.

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

3 participants