diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e905c8ef..66f1049dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,14 +103,16 @@ else( CMAKE_SIZEOF_VOID_P EQUAL 8 ) add_definitions("-DTFEL_ARCH32") endif( CMAKE_SIZEOF_VOID_P EQUAL 8 ) -#extraction svn revision -if(NOT TFEL_SVN_REVISION) -execute_process(COMMAND svnversion - WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" - OUTPUT_VARIABLE TFEL_SVN_REVISION - OUTPUT_STRIP_TRAILING_WHITESPACE) -endif(NOT TFEL_SVN_REVISION) -add_definitions("-DTFEL_SVN_REVISION=\\\"\"${TFEL_SVN_REVISION}\"\\\"") +#extraction git hash +if(NOT TFEL_GIT_HASH) +execute_process( + COMMAND git log -1 --format=%h + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE TFEL_GIT_HASH + OUTPUT_STRIP_TRAILING_WHITESPACE) +message("Abbreviated commit hash: ${TFEL_GIT_HASH}") +endif(NOT TFEL_GIT_HASH) +add_definitions("-DTFEL_GIT_HASH=\\\"\"${TFEL_GIT_HASH}\"\\\"") add_definitions("-DTFEL_CMAKE_GENERATOR=\\\"\"${CMAKE_GENERATOR}\"\\\"") # testing diff --git a/docs/web/release-notes-3.0.13.md b/docs/web/release-notes-3.0.13.md index ee8d8224a..0f16251ca 100644 --- a/docs/web/release-notes-3.0.13.md +++ b/docs/web/release-notes-3.0.13.md @@ -19,6 +19,10 @@ eqnPrefixTemplate: "($$i$$)" # Issues fixed +# Issue 87: [tfel-config] remove reference to svn revision + +For more details, see . + # Issue 466: Fix build with gcc 13 For more details, see . diff --git a/tfel-config/src/tfel-config.cxx b/tfel-config/src/tfel-config.cxx index cea1e2a70..d711a6132 100644 --- a/tfel-config/src/tfel-config.cxx +++ b/tfel-config/src/tfel-config.cxx @@ -230,7 +230,7 @@ static void listOptions(std::ostream& os) { [[noreturn]] static void treatVersion() { std::cout << "tfel-config " << VERSION - << " (svn revision : " << TFEL_SVN_REVISION << ")" << std::endl; + << " (git hash: " << TFEL_GIT_HASH << ")" << std::endl; std::exit(EXIT_SUCCESS); } // end of treatHelp