jgrodziski / metav

Release and Versioning of Clojure projects using tools.deps
Eclipse Public License 1.0
68 stars 12 forks source link

Add the distance between the current commit and the last tag #25

Open dpanza opened 2 years ago

dpanza commented 2 years ago

When generating a new meta file, we could add the distance between the last generated tag and the HEAD. So to maintain natural ordering between version (especially for generated jar or docker images, pushed in artefact repository/registry), add the distance in generated version.

Example : For a repo with the last released tag v1.0.0 When two commits (c1 and c2) have been added to the branch, generated versions with a SHA1 are not naturally sortable, because SHA1 are not intend to be sortable at all : v1.0.0-0xaaaaa (c1) > v1.0.0-0xbbbbb

A proposition could be to add the distance in generated version, which result to v1.0.0-1+aaaaa (c1) < v1.0.0-2+bbbbb (c2)

Thus, could we replace the 5 letters/digits SHA1 hexa to the standard short SHA1 from git ?