[GRASS-dev] [GRASS GIS] #3880: update/drop revision check after git switch
GRASS GIS
trac at osgeo.org
Sat Jan 11 13:27:34 PST 2020
#3880: update/drop revision check after git switch
------------------------+---------------------------------
Reporter: hellik | Owner: grass-dev@…
Type: defect | Status: reopened
Priority: blocker | Milestone: 7.8.3
Component: Compiling | Version: svn-releasebranch76
Resolution: | Keywords: svn, git, revision
CPU: All | Platform: All
------------------------+---------------------------------
Comment (by mmetz):
Regarding version and date check as in
[https://github.com/OSGeo/grass/blob/master/lib/gis/gisinit.c#L52 lib/gis
G__gisinit()],
[https://github.com/OSGeo/grass/blob/master/lib/gis/gisinit.c#L86 lib/gis
G__no_gisinit()] and
[https://github.com/OSGeo/grass/blob/master/general/g.version/main.c#L142
g.version], the hash and date of the last git commit can be easily
obtained for any file/directory and used to define
[https://github.com/OSGeo/grass/blob/master/include/gis.h#L42
GIS_H_VERSION] and
[https://github.com/OSGeo/grass/blob/master/include/gis.h#L43 GIS_H_DATE].
The hash and date of the latest commit to the `include` folder can be
obtained with e.g.
{{{
git log -1 --pretty=format:"%H|%cd" -- include
}}}
catching any changes in the GRASS header files.
This git commit hash and date can be stored in a file and then used by
`configure` to update `include/version.h` after this header has been
generated (also by configure).
Obviously, `configure` must also work if git is not available or if the
source code is not a git clone.
The challenge is to automatically update the file with the hash and date
of the latest git commit to the `include` folder. Updating and uploading
this file will require another commit. We could provide a script to update
the file with the hash and date of the latest git commit to the `include`
folder and add a [https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
git hook] to make sure this hash+date file has been updated if any changes
have been made to the `include` folder.
The challenge is to create an appropriate [https://git-scm.com/book/en/v2
/Customizing-Git-Git-Hooks git hook].
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3880#comment:17>
GRASS GIS <https://grass.osgeo.org>
More information about the grass-dev
mailing list