Hacker News new | ask | show | jobs
by epage 1486 days ago
This is what I was used to at a prior day job (another one just didn't keep a version in source). When I took over cargo-release [0], this was also the default though not anymore.

Benefits of keeping the last version

- Easier to detect when a change occurred since the last release

- (Rust specific) It makes it harder to patch a registry dependency with a git dependency because the versions will never align [1]. This is why the default changed in cargo-release.

- The "next version" is just speculation. Will the next release bump the pre-release version, patch, minor, or major?

A downside to keeping either last version or next version is if someone builds from master, the bug report could be confusing unless you include the git hash (and whether the repo was dirty).

I've seen some advocate for not keeping a version in source at all [2]. This article advocates against it but doesn't give the reason. I guess one is it requires you to have all tags locally which is a silent failure mode when you don't and disallows shallow clones.

[0] https://github.com/crate-ci/cargo-release

[1] https://github.com/crate-ci/cargo-release/issues/82

[2] https://github.com/rust-lang/cargo/issues/6583