Date: Mon, 10 Mar 2025 11:36:14 -0700
On Monday, 10 March 2025 10:01:18 Pacific Daylight Time Sebastian Wittmeier via
Std-Proposals wrote:
> If the current GIT commit is a far more useful information, our discussion
> also clarified,
>
> what possible ways could include such compile-time configuration.
>
> A generated header file or even source code file is always an option, but
> perhaps one wants to provide a nice constexpr interface for compile-time
> configuration.
Generate a source or header file that includes:
constexpr const char *gitsha1()
{
return "b35039fc8937f1327e6498c2963b0eadc88b1200";
}
Personally, for my Git ID scripts, I include the output of git describe, which
will relate to the latest tag found in history and is thus more convenient.
$ git describe --tags
28-1-g1c95ae5
Std-Proposals wrote:
> If the current GIT commit is a far more useful information, our discussion
> also clarified,
>
> what possible ways could include such compile-time configuration.
>
> A generated header file or even source code file is always an option, but
> perhaps one wants to provide a nice constexpr interface for compile-time
> configuration.
Generate a source or header file that includes:
constexpr const char *gitsha1()
{
return "b35039fc8937f1327e6498c2963b0eadc88b1200";
}
Personally, for my Git ID scripts, I include the output of git describe, which
will relate to the latest tag found in history and is thus more convenient.
$ git describe --tags
28-1-g1c95ae5
-- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Principal Engineer - Intel DCAI Platform & System Engineering
Received on 2025-03-10 18:36:16