Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference between git describe and injected version number #5

Open
sebastibe opened this issue Jun 30, 2021 · 1 comment
Open

Difference between git describe and injected version number #5

sebastibe opened this issue Jun 30, 2021 · 1 comment

Comments

@sebastibe
Copy link

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?

@juergenhoetzel
Copy link

juergenhoetzel commented Jan 16, 2022

Would you have any recommendations on how to have them match?
The default describe pattern used in lein-git-inject does not include the "g" prefix the ref group:

   :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)?)"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants