#1210 Please clarify handling of true pre-release snapshots
Opened 2 years ago by music. Modified 8 months ago

The guidelines for snapshot versioning seem to implicitly assume that a snapshot is always post-release (0.4.1^20200601g01234ae) or post-pre-release (0.5.0~rc1^20200701gdeadf00f).

There are cases, however, where a snapshot really belongs to the development branch for a future release, but there has not been a formal pre-release. If the version number in the code has already been updated for the new release, then it is incorrect to treat the snapshot as a post-release of the old version; it is truly a pre-release snapshot.

Two possibilities I can think of in this case are:

  • Allow using ~ instead of ^ before the snapshot information in the Version in this case, e.g.: 0.5.0~20220917g12345bf
  • Treat this as a pre-release having an empty name, e.g.: 0.5.0~^20220917g12345bf

The second is not explicitly disallowed by the current guidelines, but not clearly allowed either. The first is simpler. Tests with rpmdev-vercmp verify that both styles sort before any snapshot of a named pre-release, e.g. 0.5.0~rc1^20200701gdeadf00f—for the first style, assuming that the named pre-release begins with a letter—which seems like it would be a desirable property.


I ran into this myself (although it ended up being moot) but I just remembered where else I saw this situation in practice. In https://bugzilla.redhat.com/show_bug.cgi?id=2098905#c14, @carlgeorge arrived at the conclusion that the second possibility is correct. (I agree that this seems to be the best interpretation of the extant guidelines.)

Looking at the current docs, there seems to be a mistake, probably introduced when ^ based snapshot versioning was documented. It implicitly assumes that all snapshots are post-release snapshots, but for pre-release snapshots, the slightly older ~ based versioning should be used.

Login to comment on this ticket.

Metadata