From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-2.6 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD shortcircuit=no autolearn=no autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 93DAE1F404 for ; Fri, 30 Mar 2018 12:14:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751223AbeC3MOk (ORCPT ); Fri, 30 Mar 2018 08:14:40 -0400 Received: from mout.gmx.net ([212.227.15.15]:37797 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751191AbeC3MOj (ORCPT ); Fri, 30 Mar 2018 08:14:39 -0400 Received: from [192.168.0.129] ([37.201.195.115]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MFdDB-1enqhP07bZ-00Ea7K; Fri, 30 Mar 2018 14:14:22 +0200 Date: Fri, 30 Mar 2018 14:14:19 +0200 (DST) From: Johannes Schindelin X-X-Sender: virtualbox@dscho.gitforwindows.org To: Stefan Beller cc: git , Junio C Hamano , Thomas Rast , Phil Haack , Jeff King , =?UTF-8?Q?=C3=86var_Arnfj=C3=B6r=C3=B0_Bjarmason?= , Jason Frey , Philip Oakley Subject: Re: [PATCH 0/9] Assorted fixes for `git config` (including the "empty sections" bug) In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21.1 (DEB 209 2017-03-23) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Provags-ID: V03:K0:lT2KuEK8gDx0I+wRGiORWtPgS/3I5JtwiIpUE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jn6eZZyUg5QIKLGp1GnmyJrRFpqGaAFV8 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Hi Stefan, On Thu, 29 Mar 2018, Stefan Beller wrote: > On Thu, Mar 29, 2018 at 8:18 AM, Johannes Schindelin > wrote: > > > So what is the argument against this extra care to detect comments? Well, if > > you have something like this: > > > > [section] > > ; Here we comment about the variable called snarf > > snarf = froop > > > > and we run `git config --unset section.snarf`, we end up with this config: > > > > [section] > > ; Here we comment about the variable called snarf > > > > which obviously does not make sense. However, that is already established > > behavior for quite a few years, and I do not even try to think of a way how > > this could be solved. > > By commenting out the key/value pair instead of deleting it. > It's called --unset, not --delete ;) That would open the door to new bug reports when a user starts with this concocted config: [section] # This is a comment about the `key` setting key = value and then does this: git config --unset section.key git config section.key value git config --unset section.key git config section.key value git config --unset section.key git config section.key value and then ends up with a config like this: [section] # This is a comment about the `key` setting ;key = value ;key = value ;key = value key = value And note that the comment might be about `value` instead, so reusing a commented-out `key` setting won't fly, either. I *did* give this problem a couple of minutes of thought before writing my assessment that is quoted above ;-) Ciao, Dscho