summaryrefslogtreecommitdiffstats
path: root/Modules/ExternalProject.cmake
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2021-01-17 03:56:24 (GMT)
committerBrad King <brad.king@kitware.com>2021-01-28 14:32:35 (GMT)
commit1cb65e680d11ab705d737ecd96f7ebea853ca668 (patch)
treeb53e4cb4f2765dc9a82f177d7e50f4e4dd6645ed /Modules/ExternalProject.cmake
parentb369aee24d4c79ce263eaa4badb4f840ee5f0a2e (diff)
downloadCMake-1cb65e680d11ab705d737ecd96f7ebea853ca668.zip
CMake-1cb65e680d11ab705d737ecd96f7ebea853ca668.tar.gz
CMake-1cb65e680d11ab705d737ecd96f7ebea853ca668.tar.bz2
ExternalProject: Prevent the noisy detached head messages on checkout
When checking out a specific commit by its git hash, git will output a very noisy message about checking out a detached HEAD. This is not particularly helpful for us here and makes the output overall quite verbose. Add a git config setting to prevent it.
Diffstat (limited to 'Modules/ExternalProject.cmake')
-rw-r--r--Modules/ExternalProject.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 29cfba9..903dd57 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -2671,6 +2671,10 @@ function(_ep_add_download_command name)
get_property(git_progress TARGET ${name} PROPERTY _EP_GIT_PROGRESS)
get_property(git_config TARGET ${name} PROPERTY _EP_GIT_CONFIG)
+ # Make checkouts quiet when checking out a git hash (this avoids the
+ # very noisy detached head message)
+ list(PREPEND git_config advice.detachedHead=false)
+
# For the download step, and the git clone operation, only the repository
# should be recorded in a configured RepositoryInfo file. If the repo
# changes, the clone script should be run again. But if only the tag