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

John, All,

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).

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

Regards,
Yann E. MORIN.

> 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
> 

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2022-08-13 22:11 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 [this message]
2022-08-15 10:46   ` John Keeping
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=20220813221143.GA2854108@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=john@metanate.com \
    /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.