0

In my simple command line utilities written in C, I would place macro to hold the RCS version number of the primary C module. I'd then output this version number with the copyright slug. RCS would faithfully update the macro in the source code for me. I have a vague recollection of seeing something about automating semver tagging in either Git or the GitHub CLI but can't find a trace of it now.

The function I'm trying to mimic would look like this

#define VERSION_NUMBER $Revision:$

to which RCS would faithfully replace to something like:

#define VERSION_NUMBER $Revision: 1.12 $

I would then pluck the numeric Major.Minor string (1.12 above) out of the macro string for use in my slugs.

I've search the Git Pro book, GitHub Docs, here and even the Google, to no avail.

Does anyone have a clue where I could find an automatic process for this each time I push a change? I'd prefer something that worked in a semver fashion, but won't quibble if it's just a major/minor revision. I suppose even just having a commit signature would be a worst case that's better than me having to remember to change the version number manually.

Thanks, Eric

0 Answers0