CH-Earth / summa

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

fixes a bug where summa version is incorrectly stored in executable #488

Closed wknoben closed 2 years ago

wknoben commented 2 years ago

Make sure all the relevant boxes are checked (and only check the box if you actually completed the step):

Issue

Makefile contains code to store SUMMA version to be reported by summa.exe -v. In its existing form, this code always reports the most recent version ID available in Github tags (i.e. the most recent formal release).

Solution

With this change, the code will try to match the Git hash of the user's currently active branch to the hashes associated with each tag and select the correct tag, or return undefined in case the hash does not match any tags. I've chosen to set the version to undefined if no tag matches the hash to avoid creating the (false) impression that a given executable contains a specific tagged SUMMA release while this is not the case.

For example, an executable based on my bugfix branch now returns:

----------------------------------------------------------------------
     SUMMA - Structure for Unifying Multiple Modeling Alternatives
                          Version: undefined
               Build Time: Tue Aug 24 09:28:01 CST 2021
             Git Branch: bugfix/version_report-0-g7e1c0c3
          Git Hash: 7e1c0c381a35f3ed8fc786aef9325482e2c4f06e
----------------------------------------------------------------------
martynpclark commented 2 years ago

Ok to merge after conflicts resolved in whatsnew