mirror of https://github.com/ecmwf/eccodes.git
ECC-1904: API function to get the git branch
This commit is contained in:
parent
837c9afc4e
commit
634134ea14
|
@ -383,6 +383,7 @@ if(GIT_FOUND AND NOT ${GIT_EXECUTABLE} STREQUAL "")
|
|||
ecbuild_info("Found git: ${GIT_EXECUTABLE} (found version \"${GIT_VERSION_STRING}\")")
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
|
||||
OUTPUT_VARIABLE eccodes_GIT_BRANCH
|
||||
RESULT_VARIABLE nok ERROR_VARIABLE error
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" )
|
||||
ecbuild_info("ecCodes branch = ${eccodes_GIT_BRANCH}" )
|
||||
|
|
|
@ -40,8 +40,13 @@ static void print_debug_info(grib_context* context)
|
|||
#ifdef HAVE_AEC
|
||||
aec = 1;
|
||||
#endif
|
||||
grib_context_log(context, GRIB_LOG_DEBUG, "Git branch: %s", grib_get_git_branch());
|
||||
grib_context_log(context, GRIB_LOG_DEBUG, "Git SHA1: %s", grib_get_git_sha1());
|
||||
const char* git_branch = grib_get_git_branch();
|
||||
const char* git_sha1 = grib_get_git_sha1();
|
||||
if (strlen(git_branch) > 0)
|
||||
grib_context_log(context, GRIB_LOG_DEBUG, "Git branch: %s", git_branch);
|
||||
if (strlen(git_sha1) > 0)
|
||||
grib_context_log(context, GRIB_LOG_DEBUG, "Git SHA1: %s", git_sha1);
|
||||
|
||||
grib_context_log(context, GRIB_LOG_DEBUG, "Build date: %s", codes_get_build_date());
|
||||
grib_context_log(context, GRIB_LOG_DEBUG, "Features:");
|
||||
grib_context_log(context, GRIB_LOG_DEBUG, " HAVE_AEC=%d", aec);
|
||||
|
|
Loading…
Reference in New Issue