cargo-edit icon indicating copy to clipboard operation
cargo-edit copied to clipboard

Setting version metadata doesn't preserve the pre-release version

Open qartik opened this issue 8 months ago • 1 comments

An example:

❯ cargo set-version -p package -m 11.ge8fe5ff --dry-run
   Upgrading package from 0.1.17-beta.3 to 0.1.17+11.ge8fe5ff
warning: aborting set-version due to dry run
❯ cargo set-version --version
cargo-edit-set-version 0.12.3

I'd imagine the version should change to 0.1.17-beta.3+11.ge8fe5ff. Is this intentional or a bug?

qartik avatar May 15 '25 17:05 qartik

--metadata means "set the metadata on the bumped version"

The default if --bump <LEVEL> and [TARGET] are unset is to do strip pre-release versions.

This wasn't designed with "override the current metadata" in mind. We'd have to consider the importance of that use case, how it fits into the overall workflow, and when to do such a breaking change.

epage avatar May 20 '25 21:05 epage