rgburke/grv

Alias or cmd prompt for all git commands

gabeduke opened this issue · 5 comments

It would be helpful to have either an alias command or to be able to drop to a git prompt and enter any git command manually. While having aliases for specific commands through UI is nice I often just have questions or actions that could be solved w/ git commands.

For example:
:git status > shows a dialog w/ the response ( or :g status )
:git stash > ( rather than exit grv in order to stash and switch branches )

I really like this idea. GRV won't able to support the full range of actions and flags offered by the git cli commands, so it would be useful to be able to run any git command from within GRV. I will look into adding this functionality.

Awesome!! :)

Yes, this is awesome news.
thx so much for GRV.

A :git command has been added to GRV which is capable of running non-interactive git commands (i.e. those that require no user input). Output from the command is displayed in a pop-up window. For example, running :git status looks like:

grv-git-status

A :giti command has also been added which can run interactive git commands (i.e. those that require some form of user input). For this command grv suspends itself and executes the command in the controlling terminal. This is indended to be used with commands like git rebase -i HEAD~2 which will open up an editor, although it will work with any git command. For example, running :giti status looks like:

grv-giti-status

So :giti ... can be thought of as equivalent to doing :!git ... in vim.

Another aspect worth considering is defining custom key bindings to make running these commands easier:

map All gst "<grv-prompt>git status<Enter>"
map All gsl "<grv-prompt>git stash list<Enter>"
map All gsp "<grv-prompt>git stash pop<Enter>"

With the above mappings the :git status command can be run by instead typing gst or the :git stash list command by typing gsl.

This functionality is now available on master. Let me know if you have any thoughts, suggestions or feedback? Hopefully this is what was requested?

This is exactly what I was requesting! 😄