From 1cb65e680d11ab705d737ecd96f7ebea853ca668 Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Sun, 17 Jan 2021 14:56:24 +1100 Subject: 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. --- Modules/ExternalProject.cmake | 4 ++++ 1 file changed, 4 insertions(+) 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 -- cgit v0.12