From patchwork Tue Dec 1 09:55:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 11942441 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA5BFC71156 for ; Tue, 1 Dec 2020 09:56:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3C8F920657 for ; Tue, 1 Dec 2020 09:56:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="lv0CgTti"; dkim=temperror (0-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="YlrioKKH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387811AbgLAJ4n (ORCPT ); Tue, 1 Dec 2020 04:56:43 -0500 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:34939 "EHLO wout1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726099AbgLAJ4m (ORCPT ); Tue, 1 Dec 2020 04:56:42 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id C260BC45; Tue, 1 Dec 2020 04:55:56 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 01 Dec 2020 04:55:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=fCG42qws/iC7MhIKRrRE4pBttVN iHcauADEeTzKtkwk=; b=lv0CgTti8kPWrRCaQ/xs4SFZ4Q2ehBZKmZcSAOiEiQ2 VenKW04Wdp3TpPhkPpyDHI2Uj2ZIy0XoOEjGMOpnWDSUzhXSu1jV8E1z3ly8lQTJ k1FH4Ng4fYNM9UrBWM0wQeRXY1v/kgNpDB5fffQl2IwmjHQC+Srr1AVbqeS3Xs8C Jujm/S0Y0hz5HpNj+gcrxX6aERhOvbDwb3Hr3QESdvvT4oUAt1qbcRO5GrYTzyEX SKDPtF7lajfwiNadRqBZZhXgGrBOW6Fg5wKz8PMoKSkRJArYEzTgqCkd+CUDkJnp 2zRzjBaI9CCZtILvMEn7tfeIFSFqQxGyo5IPissyb9g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=fCG42q ws/iC7MhIKRrRE4pBttVNiHcauADEeTzKtkwk=; b=YlrioKKHHgtapmIz+nWNXI xsZ3CSUm6L0xl5wnIaFsI+6V3PljR75X4nitR+4G4JDmXjmhmL6+pK4XJ5P0s3yN 5Yq5kENG994i0aarrirPJgEO5SSuNhrE/HRxoeTOALpLhR/iciUBr47EALow5lz2 kdTfR2x4YU7UGGo1uV+wHoN9kxilN5AEhRO0GnmpZWtEbeXfUmpLgaRbWIGm78aC 7oxysCBxXbrTu2pDaEx653ufbtnBiWDWuCw/OJ3QEa7co9vL8f36WF6phwZaasG5 v4FCYD9Z6ra7Z/w96SeyAqCBqLIEZu7IEuZBI0TJ44Zsr8L1+Go4O2be9o2ml2WA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudeivddgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrghtrhhi tghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrh hnpeehgefhtdefueffheekgfffudelffejtdfhvdejkedthfehvdelgfetgfdvtedthfen ucfkphepjeekrdehgedrudegrdehjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpehpshesphhkshdrihhm X-ME-Proxy: Received: from vm-mail.pks.im (dynamic-078-054-014-057.78.54.pool.telefonica.de [78.54.14.57]) by mail.messagingengine.com (Postfix) with ESMTPA id 075821080068; Tue, 1 Dec 2020 04:55:54 -0500 (EST) Received: from localhost (ncase [10.192.0.11]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id 341202a8 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 1 Dec 2020 09:55:53 +0000 (UTC) Date: Tue, 1 Dec 2020 10:55:52 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: =?iso-8859-1?q?=C6var_Arnfj=F6r=F0?= Bjarmason , Junio C Hamano , Jeff King , "brian m. carlson" , Philip Oakley Subject: [PATCH v3 0/4] config: allow specifying config entries via envvar pairs Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Hi, this is the third version of my patch series which aims to implement a way to pass config entries via the enviroment while avoiding any requirements to perform shell quoting on the user's side. Major changes include: - Another test case to test interaction of GIT_CONFIG_PARAMETERS. - I've exposed `getenv_safe` and now use that to retrieve envvars to avoid platform-specific lifetime issues of returned envvar values. - I've split out a patch which performs reindentation of preexisting code to make the actual code change easier to review. Still missing is the `--config-env` way of doing things. I'd be happy to live with both ways of doing things and adopt it as part of this series, but I wasn't sure whether this would be welcome or not. Too many ways to do the same thing may be confusing in the end, even though their target audience is probably different. Patrick Patrick Steinhardt (4): environment: make `getenv_safe()` non-static config: extract function to parse config pairs config: refactor parsing of GIT_CONFIG_PARAMETERS config: allow specifying config entries via envvar pairs Documentation/git-config.txt | 12 ++++ cache.h | 1 + config.c | 99 +++++++++++++++++++++++------- environment.c | 8 +-- environment.h | 12 ++++ t/t1300-config.sh | 115 ++++++++++++++++++++++++++++++++++- 6 files changed, 220 insertions(+), 27 deletions(-) create mode 100644 environment.h