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

obtain version from git describe #14

Open
garlick opened this issue Jan 7, 2019 · 2 comments
Open

obtain version from git describe #14

garlick opened this issue Jan 7, 2019 · 2 comments

Comments

@garlick
Copy link
Member

garlick commented Jan 7, 2019

The old style CHAOS META file is still in use in this project. Drop it and get the version from git describe --always.

@pete4abw
Copy link
Contributor

See Git Describe Program. It works when git clone/pull is used. However, depending how it's used in configure.ac downloaded files will not have .git directory and may not work.

Sample configure.ac which I use:

m4_define([v_maj], [m4_esyscmd_s([./util/gitdesc.sh major])])  
m4_define([v_min], [m4_esyscmd_s([./util/gitdesc.sh minor])])  
m4_define([v_mic], [m4_esyscmd_s([./util/gitdesc.sh micro])])  
m4_define([v_ver], [v_maj.v_min.v_mic])  

Note: This will fail if tarballs are downloaded from git repo.

@garlick
Copy link
Member Author

garlick commented Mar 17, 2021

This is what I had in mind and have standardized on in other projects:

AC_INIT([flux-core],
        m4_esyscmd([git describe --always | awk '/.*/ {sub(/^v/, ""); printf "%s",$1; exit}']))

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