Where shuould the exclamation mark go if there's a scope? #67

Closed
opened 2026-02-17 11:41:38 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @woile on GitHub (Apr 17, 2019).

Hello folks, I have 2 questions regarding !.

I was wondering first, how should it be used when there's a scope?

feat(users)!: new user interface

or

feat!(users): new user interface

  1. Should the ! be mandatory? This would have 2 benefits:
  • Easier to parse just the title of the commit to find if it's a BREAKING CHANGE or not.
  • Easier to look at the git history without having to read every description.

Cheers, looking to hear your feedback! I really like it!

Originally created by @woile on GitHub (Apr 17, 2019). Hello folks, I have 2 questions regarding `!`. I was wondering first, how should it be used when there's a scope? `feat(users)!: new user interface` or `feat!(users): new user interface` 2. Should the `!` be mandatory? This would have 2 benefits: * Easier to parse just the title of the commit to find if it's a `BREAKING CHANGE` or not. * Easier to look at the git history without having to read every description. Cheers, looking to hear your feedback! I really like it!
Author
Owner

@bcoe commented on GitHub (Apr 17, 2019):

here's why I would hate for the ! to be mandatory:

git commit --allow-empty -m "fix!: hello world"
bash:  : unrecognized history modifier

☝️ ! is a special character in bash, and I would find it annoying to have to escape it or remember to use single quotes every time I make a breaking change -- I think this introduces friction for users.

I do think we might be able to make the BREAKING CHANGE optional, if a user uses a !.


As for where to place the ! it should be immediately before the : whether or not you're using a scope 👍

@bcoe commented on GitHub (Apr 17, 2019): here's why I would hate for the `!` to be mandatory: ``` git commit --allow-empty -m "fix!: hello world" bash: : unrecognized history modifier ``` :point_up: `!` is a special character in `bash`, and I would find it annoying to have to escape it or remember to use single quotes every time I make a breaking change -- I think this introduces friction for users. I _do_ think we might be able to make the `BREAKING CHANGE` optional, if a user uses a `!`. --- As for where to place the `!` it should be immediately before the `:` whether or not you're using a scope :+1:
Author
Owner

@bcoe commented on GitHub (Apr 17, 2019):

two more thoughts:

perhaps requiring one or the other (or allowing both) would help reduce friction? ! ends up being a shorthand for BREAKING CHANGE, when the description portion of the commit message is enough to describe the breaking change.

Even though I quite like the !, should we consider using another character that isn't a special character in bash.

@bcoe commented on GitHub (Apr 17, 2019): two more thoughts: perhaps requiring one or the other (or allowing both) would help reduce friction? `!` ends up being a shorthand for BREAKING CHANGE, when the description portion of the commit message is enough to describe the breaking change. Even though I quite like the `!`, should we consider using another character that isn't a special character in `bash`.
Author
Owner

@woile commented on GitHub (Apr 18, 2019):

Wow, great feedback, agreed on all the items. Thanks! I don't which one could be used, maybe &?

Something to keep in mind with symbols is that it becomes less clear for someone who doesn't know the conventions. And then more symbols might be added to the convention, becoming really hard to decipher for people.

@woile commented on GitHub (Apr 18, 2019): Wow, great feedback, agreed on all the items. Thanks! I don't which one could be used, maybe `&`? Something to keep in mind with symbols is that it becomes less clear for someone who doesn't know the conventions. And then more symbols might be added to the convention, becoming really hard to decipher for people.
Author
Owner

@damianopetrungaro commented on GitHub (Jul 4, 2019):

@Woile feel free to open it again if you have other question :D

@damianopetrungaro commented on GitHub (Jul 4, 2019): @Woile feel free to open it again if you have other question :D
Author
Owner

@locaIhost commented on GitHub (Jun 28, 2023):

I can't find an answer, did you eventually come to an agreement? It's just that I ran into this problem today, too. 😺

@locaIhost commented on GitHub (Jun 28, 2023): I can't find an answer, did you eventually come to an agreement? It's just that I ran into this problem today, too. 😺
Author
Owner

@jmewes commented on GitHub (Jul 1, 2023):

Using single quotes for the commit message doesn't cause the error.

git commit -m 'docs!: remove draft for architecture documentation'
@jmewes commented on GitHub (Jul 1, 2023): Using single quotes for the commit message doesn't cause the error. ``` git commit -m 'docs!: remove draft for architecture documentation' ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/conventionalcommits.org#67