mirror of
https://github.com/conventional-commits/conventionalcommits.org.git
synced 2026-03-22 12:44:37 -05:00
Use a sigil in commit titles for breaking changes #23
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @DominicKramer on GitHub (Apr 12, 2018).
Currently if a feature, for example, is a breaking change, a commit would look something like the following:
I am suggesting that the standard also allows the use of a special character, for example
!, in the title to specify a breaking change. It is a matter of discussion as to whether the body should still containBREAKING CHANGE.That is, the above commit could look like the following. Note the
!afterfeat:I am suggesting this change since the GitHub UI and many other tools are used that show only the title of a commit to reduce noise. This is nice, but by looking only at the title, it can be hard to identify which features and chores etc. are breaking changes. The suffix I am proposing would remedy that.
Also, it might be easier to read using a prefix, i.e.
!feat:instead offeat!:. This would also be up to discussion.@damianopetrungaro commented on GitHub (May 2, 2018):
Sometimes it may be useful to catching BC on the fly just reading the first chars of the commit message, see that I do not see a real value around this I would like to ask to @stevemao and @bcoe what do you think about this.
btw @DominicKramer you had a nice idea :)
@damianopetrungaro commented on GitHub (Jun 28, 2018):
I'll ping @hbetts too for this.
Sorry for the slow iteration @DominicKramer but I'm having super busy days.
@apetro commented on GitHub (Jul 6, 2018):
I agree that it would be helpful for the breakingness of a change to be apparent from the title of the commit message, rather than only signaled in the body or footer. As @DominicKramer notes, there are contexts in which only the title and not the body of a commit message is visible.
For changes that are breaking, the breakingness of the change might be the most important thing to say about the change. So lead with it.
A sigil could work well. It's succinct, it's unambiguous, it could be the first character of the commit message title.
But it also requires learning about Conventional Commits to understand what it means. At a cost of 6 more characters, a prefix before the title like
BREAK:( #64 ) might be understood by someone without special knowledge of Conventional Commits.The commit message title could also convey the breakingness of the change in zero characters by overloading the type: . Currently type: is typically lowercase; ALL-CAPS could signal that it's a breaking change ( #63 ).
Sigil, an additional
BREAK:prefix, ALL_CAPS type, ... something. It would help for the commit title to signal the breakingness of the change.I'd go further. The signal in the commit message title should be REQUIREd rather than just allowed, so that it can be relied upon. Am I not seeing the signal in commit message titles because they're not breaking changes, or because the option to omit the signal was taken? It's a more effective spec feature if it's REQUIREd.
@apetro commented on GitHub (Jul 9, 2018):
Blogged about desirability signalling API-breakingness of Conventional Commit messages in title rather than just in body or footer.
@ChristianMurphy commented on GitHub (Jul 9, 2018):
I like the succinctness of the
!sigil. 👍It also looks like the meaning should carry over well to non English languages.
English, Spanish, Italian, Polish, and Chinese (the five current translations of conventional commits) all use the exclamation mark in a similar way.
That could also be succinct, but to me sees less intuitive as
!.There would also be significant on the impact on existing tooling, E.G. commitlint
type-casewould need breaking changes.It also may not translate as well for readers most comfortable with non-alphabet languages, like Chinese, which don't have letter case.
Again, some concerns on the impact on existing tooling, tools expect
type(scope): message.BREAK: type(scope): messagebreaks that expectation.If going down the more verbose route, maybe the existing subtyping system could be leveraged?
category(fix:subcategory): My subjectis a valid conventional commit (source)Maybe
break(type:scope): messagecould allow break to be spelled out without diverging too far from the existing specification?@damianopetrungaro commented on GitHub (Jul 9, 2018):
I think that the
!may be a good one.About
ALL-CAPSi really disagree, it doesn't make anything explicit and may add more cognitive load and this is not good.Adding the
BREAK:as first thing of the commit message, will be really explicit but on the other hand, it will use a lot of chars and tools that may split by:the commit message won't be very happy 😄@bcoe @stevemao @hbetts this is really a good one IMHO, we may plan to add it in the specs.
If you like the idea too I'm gonna add to the discussion some maintainer of popular tools around conventional-commits.
Let me know!
@damianopetrungaro commented on GitHub (Jul 16, 2018):
🏓 @bcoe @stevemao @hbetts
@hutson commented on GitHub (Jul 16, 2018):
I'm ambivalent about this change.
That seems like something that could, or should, be improved by those tools. Why aren't they recognizing a long-standing convention used by developers to mark breaking changes?
Not sure how that would work for character based languages (such as Simplified Chinese). (An issue apparently already mentioned by @ChristianMurphy )
I agree with that statement. On a per-project basis, the use of
!must be required. How would that be achieved in practice? How does a team enforce the use of!for breaking changes?@damianopetrungaro, yes, please reach out to major language and library ecosystems. Without significant buy-in, I don't think we'll reach the mind share necessary for this change to be recognizable, and therefore, useful.
@hutson commented on GitHub (Jul 16, 2018):
I filed a support request with GitLab to see what they think of the idea of using the existing
BREAKING CHANGE:convention - https://gitlab.com/gitlab-org/gitlab-ce/issues/49305@bcoe commented on GitHub (Aug 11, 2018):
@hbetts @damianopetrungaro @DominicKramer I'm so so on this idea too. It means that a bunch of tools in the community would need to rework their parsers to parse types with a
!differently.It would be awesome for tools like GitHub and GitLab to start representing semantic information like
BREAKING CHANGE-- I wonder if @zeke has any thoughts on this, who's been advocating using conventional commit messages for electron.@zeke commented on GitHub (Aug 11, 2018):
@gr2m introduced me to
semantic-releaseabout year ago. I was immediately hooked and I've been preaching the semantic gospel ever since. The concept is easy to explain to newcomers until you get to the part about BREAKING CHANGE having to be in the commit "body", which, as many of you have noted, is hidden in many contexts (GitHub, Gitlab, your shell alias for listing one-liner commits)..I don't read all the Electron issues and PRs in detail (there are too many!), but I skim them all. Having semantic prefixes and the wip app has made skimming much easier. I know what to look at and what I can skip:
I personally like the
!suffix idea.... it might not be completely intuitive without context but it's an easy convention to learn and remember, and it's easy to spot in a list of commits.The ruby programming language uses
!as a conventional suffix too:@damianopetrungaro commented on GitHub (Aug 12, 2018):
So I think we can plan to add the
!as breaking change sigil.Anyone feel free to open a PR if you have time, I am going on vacation, so I'll be free to work on it when I'll be back 😄
@nornagon commented on GitHub (Aug 13, 2018):
i'd like to echo the concern that @apetro raised about the
!sigil being unclear to someone who isn't familiar with the conventions, and in addition, it's hard to google.Perhaps something like
breaking-feat: [...]orbreaking: feat: [...]?@damianopetrungaro commented on GitHub (Aug 13, 2018):
@nornagon messages are cut if they are longer than 50 chars on GitHub UI.
Do you think that it could be worth adding all those chars?
If you have also another single char (or not that much as
breaking) in mind feel free to contribute :)@bcoe commented on GitHub (Mar 16, 2019):
Since:
!.BREAKING CHANGE.gitlab/githubfolks to consider supporting conventional commits -- catching the BREAKING CHANGE in the message.I'd like to vote that we don't add this feature to the specification.
@ofrobots commented on GitHub (Mar 16, 2019):
GitHub and gitlab are but two tools. Having indication of breaking changes
in the abstract that is tool independent would be nice.
On Sat, Mar 16, 2019, 12:50 PM Benjamin E. Coe notifications@github.com
wrote:
@damianopetrungaro commented on GitHub (Mar 18, 2019):
I think this is the PR with most interaction we ever had!
We can try to add the
!support (or something else too it's fine) because it seems to make sense to a lot of people, and at the same time work with some github/gitlab folks.Do we know any internal?
@apetro commented on GitHub (Mar 18, 2019):
For whatever it's worth: after further rumination, I (still) like the ALL-CAPS signifies breaking change idea (#63).
Writing commit messages is like writing email, in that there's a subject and a body and there's lots of contexts in which just the subject will be shown or read. When one wants to SHOUT in email, one writes all-caps. Surely breaking an API is worth SHOUTING about. So when that feature
was a breaking change, SHOUT IT IN ALL CAPS right at the front of the commit message title, besides offering explicit clarity in the commit message body. 😄
Costs zero characters, all-caps is idiomatic for shouting on the Internet, has the nice side effect of prohibiting shouting when a change is not breaking, and overall less unjustified shouting is a boon.
@bcoe commented on GitHub (Mar 18, 2019):
@damianopetrungaro, @ofrobots and I have been discussing a compromise; what if we introduced
!as an optional addition to the commit message BUT, it must be used in conjunction withBREAKING CHANGE: description.How would this land with folks? @hutson, @apetro? @apetro it's worth mentioning that we're adding a stanza to the specification that makes the whole spec case-insensitive, so you could use your approach too.
@bcoe commented on GitHub (Apr 10, 2019):
@DominicKramer this just landed on
master.@bcoe commented on GitHub (Apr 16, 2019):
👋 we are experimenting with the addition of the
!character in the1.0.0-beta.4version of the specification.