Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-37767: [C++][CMake] Don't touch .git/index #38003

Merged
merged 1 commit into from
Oct 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cpp/cmake_modules/DefineOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this fixes the issue reliably? Is it just an implementation detail in git?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's an implementation detail.

The git describe document doesn't explain this behavior: https://git-scm.com/docs/git-describe

Here is the implementation with --dirty:

https://github.com/git/git/blob/3a06386e314565108ad56a9bdb8f7b80ac52fb69/builtin/describe.c#L669-L697

It touches .git/index (*_index() functions are used).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow great investigation!

WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
ERROR_QUIET
OUTPUT_VARIABLE ARROW_GIT_DESCRIPTION
Expand Down