Skip to content

Commit

Permalink
apacheGH-37767: [C++][CMake] Don't touch .git/index (apache#38003)
Browse files Browse the repository at this point in the history
### 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: apache#37767

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Jacob Wujciak-Jens <[email protected]>
  • Loading branch information
kou authored and dgreiss committed Feb 17, 2024
1 parent 46dce89 commit 930dde8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/cmake_modules/DefineOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 930dde8

Please sign in to comment.