From patchwork Wed Dec 16 07:52:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 11976891 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.8 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 32136C2BBCA for ; Wed, 16 Dec 2020 07:53:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E28BF23356 for ; Wed, 16 Dec 2020 07:53:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725822AbgLPHxh (ORCPT ); Wed, 16 Dec 2020 02:53:37 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:42627 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725803AbgLPHxg (ORCPT ); Wed, 16 Dec 2020 02:53:36 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 52B015C00E4; Wed, 16 Dec 2020 02:52:45 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 16 Dec 2020 02:52:45 -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=Bme5/R4hzV6zPrUuvBl8sUPu9k6 f5L82JFcrX5VlM5o=; b=MYoy4VgLNq4iBNk8M2KSU5Idb93KpfExJScW17mHwJV ChQVE1e/vwWZBwAlimln64ezGxxSNY117nfan1L4O5x/v1sBWM8Rz2tcrrj4CR49 o8j1kDdjXVdo/C0h2lt9yRjC6rK0S1kUwp3Vy2sEg/raYy/FTjYJugGqX/g1nPOL P8g+px5vMckoKHm7ZCzIQLLiqtLMClQVZZSn6yxlQvUUSrPyzb4FiAEIx7d3lD0I MaTTocvqVC1NHBvucldvdp4aDVTYWvnPsx6f384eywTZZsPbvefbdvHIKbSUZMsi ym0YZwhsox6k2sXQqq0SqoFXILYYhy7aWiQ3kseSVqw== 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=Bme5/R 4hzV6zPrUuvBl8sUPu9k6f5L82JFcrX5VlM5o=; b=BLYsF43L22HlySscU6k5gZ foY3EXg8bJtHb6HABjQvqQQFtsc2IoYvUrEHitWD82tuBlNtQ4SY/FeGD55PEXpI ZmdqG4Tbk0XzFAkYiQPnaXaCO9QtS8Eo12NwHL5I2gw/6MxZO64T74+IeGdKVH/R 4otEtR6pLrV20w330qdP9yRb4T9mt3RCgLqA9KNYo7+GkDFFQbP876Bq3QWFC1uK VxIhF3KS7INl7Bgiz51dPn7mzhZ/wypn14BKKaRPATMult5txNAFLbF2MCxQX1eI WZyDx00/v/7e6sCSDhjQ52uAp/l0DB3fTX2CEplN5Ce7qVbaVohBzbJlJ+UjHEmg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudeluddgudduudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggujgesghdtreertddtudenucfhrhhomheprfgrthhr ihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvg hrnheptdffjeeiudduleehvdfgteeifeelheejtedvteduiedttedvtdffffefhfdvgffg necukfhppeejkedrheehrddugedrudejheenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehpshesphhkshdrihhm X-ME-Proxy: Received: from vm-mail.pks.im (dynamic-078-055-014-175.78.55.pool.telefonica.de [78.55.14.175]) by mail.messagingengine.com (Postfix) with ESMTPA id 6B3591080057; Wed, 16 Dec 2020 02:52:43 -0500 (EST) Received: from localhost (ncase [10.192.0.11]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id 63d1d551 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 16 Dec 2020 07:52:39 +0000 (UTC) Date: Wed, 16 Dec 2020 08:52:38 +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 v5 0/8] config: allow specifying config entries via env 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 fifth version of my patch series which aims to implement a way to pass config entries via the environment while avoiding any requirements to perform shell quoting on the user's side. Changes in this version include: - I've adopted Jeff's patches to make GIT_CONFIG_PARAMETERS more robust by using quoting for both key and value of the config entry. This allows to store entries which for example have an equals sign in their key. - I've replaced the documentation of `git --config-env` by Ævar's, which was much better. - I've amended the documentation of GIT_CONFIG_COUNT to document the intended usecase. The series is structured as following: - Patch 1 is a while-at-it patch for the `--super-prefix` usage string which was missing in `git --help`. - Patch 2 implements `git --config-env`. - Patch 3-6 implement robust handling of GIT_CONFIG_PARAMETERS. - Patch 7-8 implement GIT_CONFIG_COUNT handling. As before, if the GIT_CONFIG_COUNT code is unwanted, please feel free to cut off after the 6th patch. Patrick Jeff King (3): quote: make sq_dequote_step() a public function config: store "git -c" variables using more robust format config: parse more robust format in GIT_CONFIG_PARAMETERS Patrick Steinhardt (5): git: add `--super-prefix` to usage string config: add new way to pass config via `--config-env` config: extract function to parse config pairs environment: make `getenv_safe()` a public function config: allow specifying config entries via envvar pairs Documentation/git-config.txt | 16 +++ Documentation/git.txt | 23 +++- cache.h | 1 + config.c | 205 ++++++++++++++++++++++++++++---- config.h | 1 + environment.c | 8 +- environment.h | 12 ++ git.c | 3 + quote.c | 15 ++- quote.h | 18 ++- t/t1300-config.sh | 220 ++++++++++++++++++++++++++++++++++- 11 files changed, 483 insertions(+), 39 deletions(-) create mode 100644 environment.h