Skip to content

Support Pre‑release Versioning #1380

@anagno

Description

@anagno

Is there an existing issue or pull request for this?

Feature description

Add first‑class support for producing pre‑release versions (e.g., alpha, beta, rc) when computing the next version in git-cliff. Many teams ship pre‑release builds to internal users or early adopters prior to a final release. Today, git-cliff can compute and bump versions, but there’s no explicit mechanism to mark the next version as a pre‑release and increment the pre‑release sequence.

Desired solution

The introduction of a new CLI flag that will instruct git-cliff to incremental the version and at the same time use pre-relase versioning. Something similar to the logic used in the the commit-and-tag-version project

Examples of usage:

git cliff --bumped-version --pre-release
git cliff --bumped-version --pre-release rc
git cliff --bumped-version --bump major --pre-release alpha
git cliff --bump minor --pre-release beta
git cliff --bump --pre-release beta

Semantics

  • If no existing pre‑release on the next version:
    • Set pre‑release to .0 (e.g., alpha.0, beta.0, rc.0).
  • If there is an existing pre‑release:
    • if the same type: increment the numeric suffix (rc.1 to rc.2).
    • If a different type: set to the new type with numeric suffix .0. (as long as we are not reducing the type of the release. For example if we already have beta.1 and the user specifies alpha, then the resulting version should be beta.2 and not alpha.0)

Furthermore, prereleases are also usually filtered out, so the implementation should also be able to handle the skip_tags options and still calculate correct the next version.

Alternatives considered

I did not find a way on the documentation to achieve the creation of preleases, without creating first the tag myself.

Additional context

Continuation of the discussion from #1345

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions