-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Align Git short aliases with Oh My Zsh #1191
Comments
Any hard feelings about this? Should I try to prepare a PR for git.aliases.bash? |
Before you embark on this, could you outline the main differences? To be honest, I think backwards-compatibility (and people's muscle memory) is more important than using the same aliases as Oh My Zsh. If you really want to use the same (and if there are huge differences), then I'd vote for adding a separate alias file like Out of curiosity: Why do you think that it's important that both use the same set of aliases? |
A bit of background on my motivation: I've only recently started working with short aliases. Before that I worked on automating the setup of development machines in a SWD agency roughly for the last year. Most of the developers were using Zsh when I joined, and new hires were forced to jump into it too, because it was a controlled, centralized setup without root access. I helped to make this more flexible, allowing a unified setup for all developers that gives freedom for - automated - custom setups, while still retaining centralized control for maintenance (but maintained from everyone in a DevOps fashion from then on). Hence, someone preferring a different distro, or Bash instead of Zsh, could have that easily too, by adding some custom adaptions to the configuration repositories. Personally, I prefer having a setup that is as close to a distro default as possible, and ideally mainstream (which translates to Ubuntu and Bash, sorry folks!). Also, the wonky magic of the Oh My Zsh prompt made me feel uncomfortable. - But that may all be just a question of taste and getting used to it! TL;DR
I've not really made an analysis yet. When you click on the two links above you'll see that - from a first impression - On My Zsh has more. Some are also different (e.g.
Three reasons:
Bottom line: I want (to provide) more freedom. What we could do
I'll give that a shot. You're right, we shouldn't punish the muscle memory of people using Bash-it today. Therefore, I'll try to find out
and put that in a PR, if it makes sense. How does that sound? See alsoYou may be interested to know that I'm also talking to the Oh My Zsh project:
|
Wow - thanks for the detailed reply! Yes, that makes a lot of sense. Please go ahead with this... Are you planning to duplicate the common aliases in each of the files ( |
I would like to try coming up with just one configuration in the long run (i.e. avoid a "run Bash-it in Oh-My-Zsh mode" feature), so it's the latter case, the common file for now. Maybe I can just have a single file with the Oh My Zsh configuration on top and the current Bash-it differences at the bottom, thus overriding aliases where there are conflicts. But I have to figure that out. The Oh My Zsh configuration seems to have constructs proprietary to Zsh that make taking things over repeatedly not a totally trivial task. Let's talk through the details once I have a better idea about what the differences really are. |
Sourcing a file seems to be possible, though it looks and feels a bit ugly. I've tried putting Oh My Zsh's Git alias plugin into a cite 'about-alias'
about-alias 'common git abbreviations'
BASHIT_HOME="$(cd -P "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
source "${BASHIT_HOME}/aliases/compat/git.plugin.zsh"
# Aliases
alias gcl='git clone'
... Is there a better way? |
The |
Done. How does the autocompletion work? Can we get this working easily with the additional aliases coming from Oh My Zsh? And |
Sorry for the late response, @bittner... Yes, summer vacation was very nice, thanks for asking. To be honest, I don't know off the top of my head whether your code would be causing any issues with these two cases. I had a quick look at the code that generates the help for the aliases (in The autocomplete will probably work, since it uses the aliases that are defined in the current shell. Best strategy for verifying this:
Sorry if this does not help much... |
hey @bittner |
Actually, this would be a super-important addition. I still have this fix on my local machine. Unless there is a very good reason not to do so, the short aliases of Bash-it and Oh My Zsh should be align as much as possible, I feel. Motivations are mentioned above. |
I see, I think that in that case, we should see what is the difference, and either create a new Thanks for opening it up again @bittner, sorry for closing it in the first place! |
@NoahGorny The zsh aliases can be seen here |
I suggest that having a single file would be ideal. I agree with @bittner that having similarity and building on popular usage are valuable in and of themselves. Its weird to do "Bash It in Oh My Zsh compatibility mode"... I'd suggest even disabling some old aliases, like |
I just think that bash-it has his own flavours of aliases, and I wouldn't like to throw them all away. Its better to leave the option for people to choose for themselves between the bash-it ones and ohmyzsh ones |
I've already used my
I completely agree. I also don't see zsh as being any particular authority on aliases in general. side note: I do wish there was a central website for shell alias discussion / best practices - then we could introduce plugins that align with them. As it is, I think adding a new separate plugin that ports the zsh git aliases as much as possible to bash, would be useful to many people. It would essentially exist to be a proper bashified port of the zsh aliases and would not stray from that mandate. That leaves the current git aliases to grow and evolve on their own, as seen fit by the bash-it community. |
Should this issue be closed now that #1831 is merged? |
Unfortunately, its not merged yet- I still need to get around and address your comments and other things as well! |
Oy! All this merging and I jumped the gun!! |
I've noticed that the short Git aliases in Bash-it do not match the ones defined by the Oh My Zsh project.
Wouldn't it be a good idea to match them? This would make it easier for users to switch between Bash and Zsh.
The text was updated successfully, but these errors were encountered: