All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Keeping <john@metanate.com>
To: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] support/download/git: disable global & system config
Date: Mon, 15 Aug 2022 11:46:29 +0100	[thread overview]
Message-ID: <YvokBS1iouu46JsD@donbot> (raw)
In-Reply-To: <20220813221143.GA2854108@scaer>

Hi Yann,

On Sun, Aug 14, 2022 at 12:11:43AM +0200, Yann E. MORIN wrote:
> On 2022-08-11 14:45 +0100, John Keeping spake thusly:
> > 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.
> 
> While I appreciate the reasoning and example, there are valid cases
> where we do want to use (at least) the user's settings, like when they
> have proxy commands (i.e. core.gitProxy or core.sshCommand) set to reach
> the outter world (e.g. because they are behind a restrictive firewall
> and need to tunnel ssh-over-https for example).

Good point - this is more complicated than I initially realised.

> So we need something better than just ignoring the local configuration,
> and this is going to be... tricky.

What do you thing about adding a config option to specify the global
gitconfig file to use?

Unfortunately we can't just default the value to ~/.gitconfig as there
is no value which replicates the behaviour when the variable is unset
(when Git uses both ~/.gitconfig and $XDG_CONFIG_HOME/git/config).

The system config is less likely to be problematic as I don't think it's
used much outside managed environments where the content probably is for
proxy settings that should be included in Buildroot.

So we end up with something like this:

	eval ${BR2_GIT_CONFIG_GLOBAL:+GIT_CONFIG_GLOBAL=\'${BR2_GIT_CONFIG_GLOBAL}\'} \
		GIT_DIR="${git_cache}/.git" ${GIT} "${@}"
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2022-08-15 10:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2022-08-15 11:41     ` Yann E. MORIN
2022-08-15 14:24       ` John Keeping

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YvokBS1iouu46JsD@donbot \
    --to=john@metanate.com \
    --cc=buildroot@buildroot.org \
    --cc=yann.morin.1998@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.