From eeddaaea52a554f812a841dc14666970169fc778 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Thu, 28 Jan 2021 13:41:05 -0600 Subject: [PATCH] Make git fetching even quieter (for git v1.7.2+)(#21013) --- lib/spack/spack/fetch_strategy.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py index b67db24c72..28f1a87c17 100644 --- a/lib/spack/spack/fetch_strategy.py +++ b/lib/spack/spack/fetch_strategy.py @@ -776,6 +776,12 @@ def git(self): if not self._git: self._git = which('git', required=True) + # Disable advice for a quieter fetch + # https://github.com/git/git/blob/master/Documentation/RelNotes/1.7.2.txt + if self.git_version >= Version('1.7.2'): + self._git.add_default_arg('-c') + self._git.add_default_arg('advice.detachedHead=false') + # If the user asked for insecure fetching, make that work # with git as well. if not spack.config.get('config:verify_ssl'):