mirror of
https://github.com/conventional-commits/conventionalcommits.org.git
synced 2026-03-22 12:44:37 -05:00
What about the revert type? #44
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 @Mouvedia on GitHub (Aug 26, 2018).
There's no mention of it.
cf https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#revert
@damianopetrungaro commented on GitHub (Aug 26, 2018):
Thank you for opening the issue @Mouvedia .
Good one ;)
I would like to specify that we do not stick to the angular convention we are just inspired by it.
Anyway we miss the
reverttype.IMHO is fine to use the Git default one
Revert "feat: Add birthdate to user model"because it doesn't add any overhead during the reverting phase and is explicit because it wrap a conventional commit message.Let's see what @conventional-commits/committee think about it.
@Mouvedia commented on GitHub (Aug 26, 2018):
@damianopetrungaro would the commit
"feat(user): Add birthdate"be the revert of the commit"feat(user): Remove birthdate"?Should the type always match the reverted commit's type? Should the message be identical?
@damianopetrungaro commented on GitHub (Aug 26, 2018):
@Mouvedia IMHO it makes sense to be
Revert "feat: Add birthdate to user model"orrevert: Add birthdate to user modelbecause Remove birthday is not a feature itself, it may be part of a fix (but this means it's not reverted).@Mouvedia commented on GitHub (Aug 26, 2018):
Personally I use the
reverttype for commits which stated purpose is to revert. For example if the original commit has some valuable artifacts, I end up with a partial revert.e.g.
revert: a6c8e75@damianopetrungaro commented on GitHub (Aug 26, 2018):
Yup, I got it, I said my opinion but before adding it to the specs I want also other people from the committee
@hutson commented on GitHub (Aug 27, 2018):
My two cents would be to simply document what
gitalready does. As noted by @damianopetrungaro usinggit revertand keeping it's auto-generated message is easy. Doing anything else just adds friction and a greater chance of not adhering to the convention.In my experience a revert is always a fix. Even if it the commit technically adds a feature, it's only because the removal of that feature was unintended (it essentially introduced a bug).
However we really should document how to handle revert commits.
@Mouvedia commented on GitHub (Aug 27, 2018):
@hbetts that doesn't cover my current usage of the revert type which is a partial revert using
git commit. The intent is a revert but granular: https://stackoverflow.com/q/45267653@damianopetrungaro commented on GitHub (Aug 27, 2018):
So @hbetts we have to face how to make it standardized also for processes that are not a simply
git revert.What do you think about it?
@hutson commented on GitHub (Aug 28, 2018):
Thank you @Mouvedia for the link. I was failing to see that you are reverting only part of a commit and not the entire commit.
So this may come down to semantics for me.
As an example, I have a commit that I introduced a long time ago. Turns out, that commit, which may have introduced a feature, also changed a line of code that, unintentionally, broke existing behavior.
I could do a partial revert. I could end up with a commit, of type revert, that removes the modification to that line of code.
However, isn't that also a
fix?@damianopetrungaro commented on GitHub (Aug 28, 2018):
yeah, you're right, this is a fix anyway.
@Mouvedia commented on GitHub (Aug 28, 2018):
Most of the time, it's the other way around: you revert the commit in the spirit on its initial message but leave out some artifacts that are worth keeping. Don't throw the baby out with the bathwater.
If it's not considered a revert, you won't use the revert type obviously.
@damianopetrungaro commented on GitHub (Aug 28, 2018):
But the point is that when you revert a feature (or a fix) you are creating a
fixfor it.@hbetts what about other commit types like docs/chore?
They aren't types that should trigger a version update, but anyhow you are reverting a commit.
So they will be just
docs(api): remove users from documented resourcesfor example.@Mouvedia commented on GitHub (Aug 28, 2018):
IMHO the short hash of the original commit should be mandatory. Since you allow custom types Ill continue to use the revert type. I was just enquiring as to why it was omitted.
@damianopetrungaro commented on GitHub (Aug 28, 2018):
@Mouvedia but
revertnot being part of the specs we may just enforce the usage in the FAQ section.@damianopetrungaro commented on GitHub (Oct 13, 2018):
@Mouvedia any other idea on this?
@Mouvedia commented on GitHub (Oct 13, 2018):
@damianopetrungaro this list should be 'build', 'ci', 'chore', 'docs', 'perf', 'refactor', 'revert', 'style', 'test'.
cf https://github.com/marionebl/commitlint/blob/master/%40commitlint/config-conventional/index.js#L19
@vmx commented on GitHub (Oct 25, 2018):
This discussion reads like there is an agreement that if you
git reverta commit, the commit message should just be what Git is doing:If it's a partial revert, you would use one of the existing types as it's probably a "fix", but it could e.g. also be "docs". You probably re-word the header anyway.
@stevemao commented on GitHub (Dec 18, 2018):
conventional-changelogcurrently implementsrevertexactly the same way as the angular docs.@damianopetrungaro commented on GitHub (Feb 8, 2019):
@stevemao @hutson @vmx any other feedback on this?
@hutson commented on GitHub (Feb 10, 2019):
If I introduce documentation that is inaccurate, I tend to revert the commit, use the
docstype, along with a description that I'm correcting inaccurate information. Same thing as chore.Again, this is just how I approach reverts. They may be some benefit to using, in-part, or in-whole, the git revert commit message that I am not aware of. Not to mention, others may find using
revertcommits to be useful in their own management of their projects, or useful in their tooling.That's a good point. We already follow the Angular convention. Are there sufficient benefits in changing?
@stevemao commented on GitHub (Feb 11, 2019):
Revert "<the original header>"is default so you don't need to change anything. The angular way you'd have to modify the header slightly:revert: <the original header>@damianopetrungaro commented on GitHub (Feb 12, 2019):
We are inspired by the Angular convention, we are not following it.
And in this way we'll be consistnet with all the other commit types
@hutson commented on GitHub (Feb 13, 2019):
😉
@damianopetrungaro do you feel we should be inspired in a different direction than the standard Angular convention? 😃
@bcoe commented on GitHub (Mar 16, 2019):
👋 my two cents,
revert:currently fits within the scope of the existing specification, and it seems fair to put the responsibility for how this is interpreted in the hands of the upstream tooling authors. I'd advocate that we document it in the FAQ like @damianopetrungaro suggests.@Mouvedia commented on GitHub (Mar 16, 2019):
I am fine with it but it needs to allow partial reverts as well.
@bcoe commented on GitHub (Mar 16, 2019):
@Mouvedia I think from conventionalcommits.org's point of view, it only cares about the prefix
revert:, the tooling author would be able to decide the meaning of everything after the:, which might be a partial revert or full revert.@Mouvedia commented on GitHub (Mar 24, 2019):
In light of TCR's emergence, the revert type may become as essential as fix and feat.
@damianopetrungaro commented on GitHub (Jul 4, 2019):
@bcoe @Mouvedia @hutson do we want to add it in the specs?
@Mouvedia commented on GitHub (Jul 4, 2019):
If it allows partial reverts and has the requirement to include the SHA(s) of the guilty commit(s) in the message, yes we should.
@damianopetrungaro commented on GitHub (Jul 5, 2019):
IMHO sth like that may work:
@Mouvedia commented on GitHub (Jul 5, 2019):
Maybe instead of a requirement adding references could be a recommendation.
@bcoe commented on GitHub (Aug 14, 2019):
I would advocate that for revert commits we suggest in the footer "refs: x" which could be a sha or PR number. This seems less fragile than wrapping the original message.
It's then up to tooling on a specific platform to lookuo the ref.
@bcoe commented on GitHub (Sep 7, 2019):
see: https://github.com/conventional-commits/conventionalcommits.org/pull/175/files#diff-4d1a596d11b78953177b1c0bc67d9f4fR176
I've added the following blurb regarding revert commits:
I'm convinced that it's beyond the scope of the Conventional Commit specification to strictly define how reverts should be managed, but I think this FAQ provides a reasonable starting point for tooling authors.
I personally like a
revert:type withRefs:footer because:Revert "<the original header>",revert:follows the existing specification (I don't like the idea of extending the spec for this edge-case).@Mouvedia commented on GitHub (Sep 7, 2019):
You should remove the #.
@soullivaneuh commented on GitHub (Mar 19, 2020):
What is the state of this issue?
Personally, I just used the
git revertcommand, leaving the original message and the release process works well:@nunokaeru commented on GitHub (Jan 18, 2023):
I recommend.
Reverts should still follow the other standards, therefore a revert commit should be
revert: "original revert message"and also that the following additions should be made to it.