I am developing a program in C that needs to include the date and the time of the last push performed in a given branch in the git repository in order to version it.
I know how I can get the data from git and use it to generate a version number in the format I want. (https://stackoverflow.com/a/51403241/7114946)
The problem is I don't know how to include this within the code of the program because it ultimately needs to "printf" this info during the starting of the app.
I have found the preprocessor macros __TIME__
and __DATE__
. I wonder if there are other similar macros to include some given string/data.
Thanks
edit: I need to include this info in compilation time, not when the code is uploaded into git.