CH-Earth / summa

Structure for Unifying Multiple Modeling Alternatives:
http://www.ral.ucar.edu/projects/summa
GNU General Public License v3.0
80 stars 105 forks source link

Make SUMMA VERSION message independent of .git directory presence #367

Open bartnijssen opened 4 years ago

bartnijssen commented 4 years ago

The SUMMA version message (as displayed by summa.exe -v) is created at compile time from information that is present in the .git directory. This results in a message that includes the version, git-branch, and git-hash that are used in the build. For example

----------------------------------------------------------------------
     SUMMA - Structure for Unifying Multiple Modeling Alternatives
                              Version:
               Build Time: Tue Oct  1 16:29:27 UTC 2019
             Git Branch: remotes/origin/master-0-g8e76c15
          Git Hash: 8e76c1594b7f6d745eeeb0573f87228516c64350
----------------------------------------------------------------------

However, this requires that the .git directory tree is present at the time of the build, which is not always true (for example when people download the code and then build).

Proposed solution: Created a VERSION file in the SUMMA repo that includes this information and which gets read at compile time. The file should be automatically updated when a new commit is made (via a commit-hook?).