All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] support/download/git: disable global & system config
@ 2022-08-11 13:45 John Keeping
  2022-08-13 22:11 ` Yann E. MORIN
  0 siblings, 1 reply; 5+ messages in thread
From: John Keeping @ 2022-08-11 13:45 UTC (permalink / raw)
  To: buildroot; +Cc: John Keeping, Yann E . MORIN

The build environment should be isolated from the host system as much as
possible to keep the build reproducible.  Git's global config (usually
~/.gitconfig) and system config (/etc/gitconfig) can affect the
behaviour of all Git operations, so should be disabled.

An example of this is that `git lfs install` will add the LFS smudge
filter to the global config and thus always checkout LFS files ignoring
the value of $(PKG)_GIT_LFS.  This may mask a bug in the package when
the initial developer's machine has LFS installed globally.

Signed-off-by: John Keeping <john@metanate.com>
---
 support/download/git | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/support/download/git b/support/download/git
index 1a1c315f73..b0a677c3a3 100755
--- a/support/download/git
+++ b/support/download/git
@@ -82,13 +82,17 @@ trap _on_error ERR
 # being expanded a second time (in case there are spaces in them)
 _git() {
     if [ -z "${quiet}" ]; then
-        printf '%s ' GIT_DIR="${git_cache}/.git" ${GIT} "${@}"; printf '\n'
+        printf '%s ' GIT_CONFIG_GLOBAL=/dev/null \
+            GIT_CONFIG_SYSTEM=/dev/null \
+            GIT_DIR="${git_cache}/.git" ${GIT} "${@}"
+        printf '\n'
     fi
     _plain_git "$@"
 }
 # Note: please keep command below aligned with what is printed above
 _plain_git() {
-    eval GIT_DIR="${git_cache}/.git" ${GIT} "${@}"
+    eval GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_SYSTEM=/dev/null \
+        GIT_DIR="${git_cache}/.git" ${GIT} "${@}"
 }
 
 # Create a warning file, that the user should not use the git cache.
-- 
2.37.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-08-15 14:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-11 13:45 [Buildroot] [PATCH] support/download/git: disable global & system config John Keeping
2022-08-13 22:11 ` Yann E. MORIN
2022-08-15 10:46   ` John Keeping
2022-08-15 11:41     ` Yann E. MORIN
2022-08-15 14:24       ` John Keeping

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.