lein-git-inject
lein-git-inject copied to clipboard
Difference between git describe and injected version number
In my batch deployment script I am trying to generate the release version from git describe as mentioned in the README using git describe --tags --dirty=-SNAPSHOT (returning for example 1.1.9-7-gf2e285aa-SNAPSHOT). However, The version number doesn't match with the one in my Clojure code as the "g" prefix on the commit number is missing (i.e. 1.1.9-7-f2e285aa-SNAPSHOT).
Would you have any recommendations on how to have them match?
Would you have any recommendations on how to have them match? The default describe pattern used in
lein-git-injectdoes not include the "g" prefix therefgroup:
:describe-pattern #"(?<tag>.*)-(?<ahead>\d+)-g(?<ref>[0-9a-f]*)(?<dirty>(-dirty)?)"
You can customize the pattern to include the "g" prefix in your project.clj:
:git-inject {:ignore-dirty? true
:describe-pattern #"(?<tag>.*)-(?<ahead>\d+)-(?<ref>g[0-9a-f]*)(?<dirty>(-dirty)?)"}