From patchwork Tue Oct 30 18:40:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila_via_GitGitGadget?= X-Patchwork-Id: 10661421 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C4A303CF1 for ; Tue, 30 Oct 2018 18:40:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC5612AA7D for ; Tue, 30 Oct 2018 18:40:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C0EF12AA86; Tue, 30 Oct 2018 18:40:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF7F82AA85 for ; Tue, 30 Oct 2018 18:40:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727591AbeJaDel (ORCPT ); Tue, 30 Oct 2018 23:34:41 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:41770 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726376AbeJaDel (ORCPT ); Tue, 30 Oct 2018 23:34:41 -0400 Received: by mail-pf1-f194.google.com with SMTP id e22-v6so3259618pfn.8 for ; Tue, 30 Oct 2018 11:40:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:from:subject:fcc:content-transfer-encoding :mime-version:to:cc; bh=E91ZmptrsqYkwGUGeh/SPaqrGysUpDEl3i1rHvSrVrY=; b=OzhlXd0faTfu5Fpw590DHpHx7DKXC2S4UJk/sujtfHTSxk1z5Hp660/0XTxzmFO8mP SPwksiuKsITkUhsegrP93htvVawpQsm+9plA3iNBHuWPQ7mWuZvtfJ3HXonxIRDUf9SK Ik0Kn5V0YmDgUdc++6gGyIvLFQlVP0N0/v7irnihs8orebgNjccVnhBfhV423oWO5kgp n7YPIEaWlL4pj3vc3oyIP+S19CDB8ZV7i8vJKTL98v+JZfHmt26tedO3w6FtlWjlCJi3 +vOfMiGJnKZqse7at/OoMR0LRnSrtvb5Rn/lqpdkSgucGmMuk7lZ8KKwbSpRH6YZe6Xv Hntg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:from:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=E91ZmptrsqYkwGUGeh/SPaqrGysUpDEl3i1rHvSrVrY=; b=Cl0WOAx+c3sUXPqh2mKPrds+vnDU0H+CTxP9He+WFTfruwAxijngV6Ajt7Ok1wGlWE NF5Q0N8rSk/Nw5/M/ey54AEDJJNJhlIcQH6zADoFthTgaeU5Ol9E2FJObu1FSEgYunxr RK4qeGkgVYg435p5FfXp/geY4y6kbqm3ECsvznZUQjILc7Fjsj898gXMKTLs4RWtGDrT o+u8jUL2BIUQJr4Vc2L3ASr64opNPVCjqLIhW+PHfCC3hynOgPUeoP6bynsI3aAqWWN6 rfcwnN3mPehGE6B1uUiygbCeWLOEprv1EAHi0KQaLMin7lGY1HxiR4MqYY6fQ18kJAaK eAjw== X-Gm-Message-State: AGRZ1gIiZhUg8sKmQQEIOnytAW23L2V36Hk+rKsEkvXngxHy81O4Mboz AqWS6NaAxKMFbhpfZfjBxA8OPfXJ X-Google-Smtp-Source: AJdET5ejbJD1Ond/220FIQyN6N9tsGgsx5IV/EL/wFDQX45M2dKhhF4IjhSfe0gwsocvQaUt27sXgw== X-Received: by 2002:a63:9304:: with SMTP id b4-v6mr45577pge.36.1540924802878; Tue, 30 Oct 2018 11:40:02 -0700 (PDT) Received: from [127.0.0.1] ([40.112.137.127]) by smtp.gmail.com with ESMTPSA id y144-v6sm34455063pfb.81.2018.10.30.11.40.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Oct 2018 11:40:02 -0700 (PDT) Date: Tue, 30 Oct 2018 11:40:02 -0700 (PDT) X-Google-Original-Date: Tue, 30 Oct 2018 18:39:55 GMT Message-Id: From: "Johannes Schindelin via GitGitGadget" Subject: [PATCH 0/4] mingw: prevent external PERL5LIB from interfering Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Junio C Hamano Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In Git for Windows, we do not support running the Perl scripts with any random Perl interpreter. Instead, we insist on using the shipped one (except for MinGit, where we do not even ship the Perl scripts, to save on space). However, if Git is called from, say, a Perl script running in a different Perl interpreter with appropriately configured PERL5LIB, it messes with Git's ability to run its Perl scripts. For that reason, we devised the presented method of defining a list of environment variables (via core.unsetEnvVars) that would then be unset before spawning any process, defaulting to PERL5LIB. An alternative approach which was rejected at the time (because it interfered with the then-ongoing work to compile Git for Windows using MS Visual C++) would patch the make_environment_block() function to skip the specified environment variables before handing down the environment block to the spawned process. Currently it would interfere with the mingw-utf-8-env patch series I sent earlier today [https://public-inbox.org/git/pull.57.git.gitgitgadget@gmail.com]. While at it, this patch series also cleans up house and moves the Windows-specific core.* variable handling to compat/mingw.c rather than cluttering environment.c and config.c with things that e.g. developers on Linux do not want to care about. Johannes Schindelin (4): config: rename `dummy` parameter to `cb` in git_default_config() Allow for platform-specific core.* config settings Move Windows-specific config settings into compat/mingw.c mingw: unset PERL5LIB by default Documentation/config.txt | 6 ++++ cache.h | 8 ----- compat/mingw.c | 58 +++++++++++++++++++++++++++++++++++- compat/mingw.h | 3 ++ config.c | 18 ++++------- environment.c | 1 - git-compat-util.h | 8 +++++ t/t0029-core-unsetenvvars.sh | 30 +++++++++++++++++++ 8 files changed, 109 insertions(+), 23 deletions(-) create mode 100755 t/t0029-core-unsetenvvars.sh base-commit: 4ede3d42dfb57f9a41ac96a1f216c62eb7566cc2 Published-As: https://github.com/gitgitgadget/git/releases/tags/pr-62%2Fdscho%2Fperl5lib-v1 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-62/dscho/perl5lib-v1 Pull-Request: https://github.com/gitgitgadget/git/pull/62