Skip to content

Revert commits aren't handled correctly #402

Open

Description

@cpcloud

The problem

Commits that have revert: type(scope): message in them aren't handled correctly if they introduce would-be-release-producing-changes.

For example creating a commit like

type(scope): message

Did a thing

BREAKING CHANGE: Really did a thing

And then reverting that with a commit

revert: type(scope): message

This reverts commit $SHA1

Still results in a major release even though no major release changes have occurred.

Expected behavior

I would expect the behavior that is tested here https://github.com/semantic-release/commit-analyzer/blob/8bcde5c83e84a0373049250f1b35988621b11088/test/integration.test.js#L100-L112

That is:

Unreleased pairs of commits where the first commit would cause a version change and the second commit is a revert of the first do not cause any changes in the version.

Activity

  1. added
    bugSomething isn't working properly
    on Jan 4, 2022
  2. cpcloud commented on Jan 4, 2022

    @cpcloud
    Author
  3. danth commented on Jan 4, 2022

    @danth
    Contributor

    Unreleased pairs of commits should be ignored.
    If the original commit was released, would you expect the revert commit to trigger a second release? If so, what level of version bump?

  4. cpcloud commented on Jan 4, 2022

    @cpcloud
    Author

    Unreleased pairs of commits should be ignored.

    Indeed, but they are not at the moment.

    If the original commit was released, would you expect the revert commit to trigger a second release? If so, what level of version bump?

    The behavior of the JS implementation is to trigger a patch release for a revert commit that's already in a release.

    I'm not sure whether that's the right level of bump for all situations. An argument can be made that any reverted released commits that triggered a release (with the exception of perf) are a breaking change since code written between the commit and the reverted commits can break if it's depending on a bug fix, feature introduction or breaking change.

  5. cpcloud commented on Jan 23, 2022

    @cpcloud
    Author

    I have since stopped using python-semantic-release so this is no longer an issue for me.

  6. danth commented on Jan 23, 2022

    @danth
    Contributor

    Perhaps this should be left open, since it could be an important feature for other users?

  7. jacksbox commented on Feb 8, 2022

    @jacksbox
    Contributor

    @cpcloud wired place to ask, but I can't find a way to reach out for you otherwise: do you have an other package recommendation which handles semantic-releases better?

  8. cpcloud commented on Feb 8, 2022

    @cpcloud
    Author

    @cpcloud wired place to ask, but I can't find a way to reach out for you otherwise: do you have an other package recommendation which handles semantic-releases better?

    @jacksbox

    You can use the semantic-release/exec plugin to execute shell scripts in the different stages.

    Here's one of my projects that does this: https://github.com/cpcloud/protoletariat

    The scripts are here: https://github.com/cpcloud/protoletariat/tree/main/ci/release
    Config is here: https://github.com/cpcloud/protoletariat/blob/main/.releaserc.json

  9. added
    help-wantedExtra attention is required
    and removed
    help-wantedExtra attention is required
    on Nov 14, 2022
  10. 21 remaining items

  11. github-actions commented on Dec 13, 2025

    @github-actions

    It has been 90 days since the last update on this confirmed issue. @python-semantic-release/team can you provide an update on the status of this issue?

  12. codejedi365 commented on Dec 14, 2025

    @codejedi365
    Contributor

    No update yet, still in backlog

  13. github-actions commented on Mar 15, 2026

    @github-actions

    It has been 90 days since the last update on this confirmed issue. @python-semantic-release/team can you provide an update on the status of this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working properlyconfirmedPrevent from becoming staleneeds-updateNeeds status update from maintainers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions