grass icon indicating copy to clipboard operation
grass copied to clipboard

configure: enable read Git hash and date from file

Open nilason opened this issue 1 year ago • 4 comments

Enable configure to read GRASS_HEADERS_GIT_HASH and GRASS_HEADERS_GIT_DATE from a file include/VERSION_GIT (if it exist). That file can be generated in the process of packaging the release tarball, leading to consistent versioning even without Git.

The VERSION_GIT file is expected to contain:

cat include/VERSION_GIT
7d9bc3610
2024-02-17T15:36:05+00:00

First step in solving #3430.

nilason avatar Feb 17 '24 18:02 nilason

Updated with fixed tests.

if test "$GIT" != "no" ; then only checks for presence of git the command/program.

nilason avatar Feb 17 '24 19:02 nilason

Added include/VERSION_GIT-file generation script. (Initially I planned to have this code in the workflow file, but decided it is better to have it in source).

nilason avatar Feb 18 '24 15:02 nilason

I tested this PR by creating include/VERSION_GIT and than removing .git directory (which is not located in tarball):

checking for include/VERSION_GIT... yes
fatal: not a git repository (or any of the parent directories): .git
grep VERSION_GIT include/Make/Platform.make
GRASS_VERSION_GIT   = exported

In this case Git hash should be propagated from the file @nilason right?

landam avatar Feb 20 '24 09:02 landam

I tested this PR by creating include/VERSION_GIT and than removing .git directory (which is not located in tarball):

checking for include/VERSION_GIT... yes
fatal: not a git repository (or any of the parent directories): .git
grep VERSION_GIT include/Make/Platform.make
GRASS_VERSION_GIT   = exported

In this case Git hash should be propagated from the file @nilason right?

True, corrected this with d9bca18.

nilason avatar Feb 20 '24 10:02 nilason

Any thoughts on this one, @landam , @neteler , anyone?

nilason avatar Mar 21 '24 14:03 nilason