From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 197E01F5AE for ; Mon, 3 Aug 2020 20:16:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726825AbgHCUQA (ORCPT ); Mon, 3 Aug 2020 16:16:00 -0400 Received: from pb-smtp20.pobox.com ([173.228.157.52]:64818 "EHLO pb-smtp20.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbgHCUQA (ORCPT ); Mon, 3 Aug 2020 16:16:00 -0400 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 4CC02F5510; Mon, 3 Aug 2020 16:15:58 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=dOYgKmw2RTd17sgQMWwCdmgw4Lk=; b=f7M84U wdpEMW6MfAdizBapbzDJex8ai57W7HfcCtHk3w9CDO27NLfRVP/2U8Lx3pmH1OJm aA1O1fXTntm7QhABfRTa7t/OghCn5apAOHqB3f2FP2BAPZSk8oogUcyCjmXf7T4L h0+6MUn5OQ3Otb9+zO+z8kMNHQobCKeWhtbtg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=U46dXuODspDIzbl/dErKzJGu7HRwnyDa Kys8OoZP1XtOGYMTZUPwwek0Q05qegykjrhgbVZNdEyD1b7Tk+mEIXiql9Q9WO+K Abd1IkKP3kCiJgqbUL0hiluR3W5qoRXLrCClBkA4PqqpsDbT8YvX91WSTQ5jpDH4 xgW1IcZGjvU= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 45160F550F; Mon, 3 Aug 2020 16:15:58 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [35.196.173.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id 7139EF550D; Mon, 3 Aug 2020 16:15:55 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Kyle Meyer Cc: git@vger.kernel.org Subject: Re: Confused about git-config's description of escaping References: <878sevwn0g.fsf@kyleam.com> Date: Mon, 03 Aug 2020 13:15:53 -0700 In-Reply-To: <878sevwn0g.fsf@kyleam.com> (Kyle Meyer's message of "Mon, 03 Aug 2020 15:24:47 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 22F25A26-D5C6-11EA-A5AD-F0EA2EB3C613-77302942!pb-smtp20.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Kyle Meyer writes: > When describing the configuration syntax, the git-config manpage says > this about the value: > > Inside double quotes, double quote " and backslash \ characters must > be escaped: use \" for " and \\ for \. > > I find the "Inside double quotes" part confusing because escaping these > characters appears to also be needed when there are no enclosing double > quotes: > > $ nl .git/config | tail -n2 > 6 [a] > 7 b = c"d > > $ git config a.b > fatal: bad config line 7 in file .git/config > > $ git version > git version 2.28.0.236.gb10cc79966 > > I was going to suggest dropping the "Inside double quotes" qualifier. > Perhaps > > Double quote " and backslash \ characters in the value must > be escaped: use \" for " and \\ for \. > > But it looks like that's pretty close to how this sentence was written > before ff5507ed2a (Documentation/config.txt: describe the structure > first and then meaning, 2015-03-04), which makes me think that I'm > misreading the description or otherwise missing something. > > What's gained by specifying "Inside double quotes"? Are there any cases > where a value, whether enclosed in double quotes or not, doesn't need " > or \ characters escaped? Perhaps there is another description missing, either from the written docs or from your reading of it, that says that a value with these characters must be enclosed in double quotes pair?