From patchwork Mon Sep 24 22:24:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Oakley X-Patchwork-Id: 10612959 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 8537214BD for ; Mon, 24 Sep 2018 22:32:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7EBE62A1C3 for ; Mon, 24 Sep 2018 22:32:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 72F5C2A184; Mon, 24 Sep 2018 22:32:52 +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=-7.9 required=2.0 tests=BAYES_00,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 04DC72A1C3 for ; Mon, 24 Sep 2018 22:32:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726122AbeIYEhQ (ORCPT ); Tue, 25 Sep 2018 00:37:16 -0400 Received: from smtp-out-4.talktalk.net ([62.24.135.68]:32648 "EHLO smtp-out-4.talktalk.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725944AbeIYEhQ (ORCPT ); Tue, 25 Sep 2018 00:37:16 -0400 Received: from localhost.localdomain ([92.29.14.162]) by smtp.talktalk.net with SMTP id 4ZHUgIql1oI6L4ZHVgLKqc; Mon, 24 Sep 2018 23:24:42 +0100 X-Originating-IP: [92.29.14.162] X-Spam: 0 X-OAuthority: v=2.3 cv=FOE1Odgs c=1 sm=1 tr=0 a=NXc+vVEgz70gitWznrz3ig==:117 a=NXc+vVEgz70gitWznrz3ig==:17 a=5rxgeBVgAAAA:8 a=S6JmO2vaAAAA:8 a=xtxXYLxNAAAA:8 a=5qj-N4dWq4Iw6-1wYJYA:9 a=PwKx63F5tFurRwaNxrlG:22 a=9Bf777meHY6sFTcdLnoB:22 a=xts0dhWdiJbonKbuqhAr:22 From: Philip Oakley To: Git Mailing List Cc: Philip Oakley , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= , Junio C Hamano , Jeff King , =?utf-8?q?Ma?= =?utf-8?q?rtin_=C3=85gren?= , stas@stason.org Subject: [PATCH 1/1] config doc: highlight the name=value syntax Date: Mon, 24 Sep 2018 23:24:16 +0100 Message-Id: <20180924222416.5240-2-philipoakley@iee.org> X-Mailer: git-send-email 2.19.0.windows.1 In-Reply-To: <29173fd8-ce72-0927-9bfe-786442dfd82c@stason.org> References: <29173fd8-ce72-0927-9bfe-786442dfd82c@stason.org> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfEia0+iW21EouvnpbrqXaq1l+35QZoDfoN49FcVUYpFNxkd6JwRPZXK7Id2jsG/zNyK4PRg5nhRy1bZPSz+CfyrBmG0j7+aG1fl5oXRL81PKIQVyfFiK ayLuiKnLf9zDJvdi5iaIvrj18nHW/sFdi9srAwIUgx0gLvAjbiXjri1iKdHBfZr9MWrGcfxaM7pKDWVfJR//luAYAawHYlF8MCeYrQbcU+ctq4arHawTmfqA mudbWp1/djJDdXqF79JyVbaI4wYHkv/9PwG7ZyhO9ZapEu+WoP4Fj6+z4houMYcmkFKeWkqkARuFiWHKOd3IHreTs33x5x53utf98r3sriJ4+JySBUENj967 tgB8CfMp Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Stas Bekman reported [1] that Git config was not accepting single quotes around a filename as may have been expected by shell users. Highlight the 'name = value' syntax with its own heading. Clarify that single quotes are not special here. Also point to this paragraph in the 'include' section regarding pathnames. In addition clarify that missing include file paths are not an error, but rather an implicit 'if found' for include files. [1] https://public-inbox.org/git/ca2b192e-1722-092e-2c54-d79d21a66ba2@stason.org/ Reported-by: Stas Bekman Signed-off-by: Philip Oakley --- Documentation/config.txt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index 1264d91fa3..b65fd6138d 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -19,8 +19,8 @@ characters and `-`, and must start with an alphabetic character. Some variables may appear multiple times; we say then that the variable is multivalued. -Syntax -~~~~~~ +Config file Syntax +~~~~~~~~~~~~~~~~~~ The syntax is fairly flexible and permissive; whitespaces are mostly ignored. The '#' and ';' characters begin comments to the end of line, @@ -56,6 +56,9 @@ syntax, the subsection name is converted to lower-case and is also compared case sensitively. These subsection names follow the same restrictions as section names. +Variable name/value syntax +^^^^^^^^^^^^^^^^^^^^^^^^^^ + All the other lines (and the remainder of the line after the section header) are recognized as setting variables, in the form 'name = value' (or just 'name', which is a short-hand to say that @@ -69,7 +72,8 @@ stripped. Leading whitespaces after 'name =', the remainder of the line after the first comment character '#' or ';', and trailing whitespaces of the line are discarded unless they are enclosed in double quotes. Internal whitespaces within the value are retained -verbatim. +verbatim. Single quotes are not special and form part of the +variable's value. Inside double quotes, double quote `"` and backslash `\` characters must be escaped: use `\"` for `"` and `\\` for `\`. @@ -89,10 +93,14 @@ each other with the exception that `includeIf` sections may be ignored if their condition does not evaluate to true; see "Conditional includes" below. +Both the `include` and `includeIf` sections implicitly apply an 'if found' +condition to the given path names. + You can include a config file from another by setting the special `include.path` (or `includeIf.*.path`) variable to the name of the file to be included. The variable takes a pathname as its value, and is -subject to tilde expansion. These variables can be given multiple times. +subject to tilde expansion and the value syntax detailed above. +These variables can be given multiple times. The contents of the included file are inserted immediately, as if they had been found at the location of the include directive. If the value of the