I try to use Conventional Commits in my public Git repositories. I wasn’t used to the Angular style, so it felt a bit weird at the beginning. The best part is that I don’t have to think about the scope of changes when I push. They’re automatically translated by a GitHub Action into Semantic Versions . I really like SemVer, as it makes it easy to see how difficult an upgrade might be, but it’s harder from a developer’s perspective to remember what constitutes a major, minor, or patch change.
I don’t introduce breaking changes very often, so I was surprised when I tried this:
$ git commit -am "chore!: drop Java 11 support"
zsh: illegal modifier:
What the heck?
That’s how I learned what ! does in ZSH: it’s used for history expansion. For example:
!!- repeats the last command.!ls- repeats the last command that starts withls.!123- repeats the 123rd command from your history.
It works also in quoted strings! This article explains it deeper.
The thing is, I’m a heavy user of Ctrl+R. On bash, it was quite primitive, but with zsh and fzf, it’s amazing . I would never exchange that for the “bang” syntax, so I found a way to disable it:
echo "setopt NO_BANG_HIST" >> ~/.zshrc
This adds to my already lengthy Zsh history config
. Now, let’s reload zsh:
source ~/.zshrc
And it’s gone. I can use “bangs” in quotes as much as I want.
