Version numbering for untagged commits creates confusion. People see 3.5.9git and wonder where they can get version 3.5.9, before it is released.
Suggestion: use the git describe --long --tags --dirty --always
See here
The result of this command can be used in a makefile to define a C macro (to pass to gcc with - D), which generates a relevant version number everytime you run make.
The result is:
<last tag>[-g<SHA1>][-dirty]
, or something along that line. Last tag is used, instead of upcoming version.
If another commit is checked out, you know which one. If there are local changes for that build, you know that too.
If that looks like a good idea, I can work on that next week.
Version numbering for untagged commits creates confusion. People see 3.5.9git and wonder where they can get version 3.5.9, before it is released.
Suggestion: use the
git describe --long --tags --dirty --alwaysSee here
The result of this command can be used in a makefile to define a C macro (to pass to gcc with - D), which generates a relevant version number everytime you run make.
The result is:
, or something along that line. Last tag is used, instead of upcoming version.
If another commit is checked out, you know which one. If there are local changes for that build, you know that too.
If that looks like a good idea, I can work on that next week.