From 930dde88c1d2d54ad02760679f364b0e57369187 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 11 Oct 2023 10:31:37 +0900 Subject: [PATCH] GH-37767: [C++][CMake] Don't touch .git/index (#38003) ### Rationale for this change We run "git describe --tag --dirty" implicitly in cpp/cmake_modules/DefineOptions.cmake. If we use "--dirty", .git/index's owner may be changed. Because "git describe" touches .git/index for "--dirty". We can avoid changing .git/index's owner by not using "--dirty". ### What changes are included in this PR? Remove "--dirty". ### Are these changes tested? Yes. I used "strace git describe ...". ### Are there any user-facing changes? No. * Closes: #37767 Authored-by: Sutou Kouhei Signed-off-by: Jacob Wujciak-Jens --- cpp/cmake_modules/DefineOptions.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/cmake_modules/DefineOptions.cmake b/cpp/cmake_modules/DefineOptions.cmake index 38d33a611ec70..cce21b6bdba24 100644 --- a/cpp/cmake_modules/DefineOptions.cmake +++ b/cpp/cmake_modules/DefineOptions.cmake @@ -751,7 +751,7 @@ if(NOT ARROW_GIT_ID) OUTPUT_STRIP_TRAILING_WHITESPACE) endif() if(NOT ARROW_GIT_DESCRIPTION) - execute_process(COMMAND "git" "describe" "--tags" "--dirty" + execute_process(COMMAND "git" "describe" "--tags" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ERROR_QUIET OUTPUT_VARIABLE ARROW_GIT_DESCRIPTION