jhillyerd / plugin-git

Git aliases plugin for the Fish shell (similar to oh-my-zsh git)
MIT License
607 stars 85 forks source link

Some aliases are not expanded automatically #97

Closed niklasnatter closed 1 year ago

niklasnatter commented 1 year ago

Hey, thanks a lot for working on this plugin. It is part of my daily workflow and I would not want to miss it!

I noticed that some aliases (like ggp) are not expanded automatically when pressing enter/space. I dont know too much about fish yet, but by looking at the source code of the plugin i figured that this is because some aliases are implemented as function (ggp, ggl) while others are implemented as abbreviations (gll, gcom).

I really like the abbreviations functionality of fish because it allows me to easily check the full command behind the alias by pressing space. Is there a specific reason why some aliases are implemented as function?

Thanks a lot in advance!

jhillyerd commented 1 year ago

Yes, you are correct that functions are not expanded in the same way. When I started the plugin, I only put bare git commands in the abbreviations, anything that relied on expanding the current or main branch names was a function. That's probably not necessary for any of the one liners. Some like grename and gtest are more complex and wouldn't work as an abbr.

If you are interested in migrating some of the simple ones back to abbr, I'd accept PRs for that. Please test them, we do not have any automated testing.

niklasnatter commented 1 year ago

Hey, thanks for the fast response! I created a small pull request to adjust the simple aliases to use abbreviations: https://github.com/jhillyerd/plugin-git/pull/98