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=-3.7 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD shortcircuit=no autolearn=ham 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 BA8441FE90 for ; Wed, 19 Apr 2017 13:11:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934302AbdDSNLe (ORCPT ); Wed, 19 Apr 2017 09:11:34 -0400 Received: from mout.web.de ([217.72.192.78]:50746 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934280AbdDSNLa (ORCPT ); Wed, 19 Apr 2017 09:11:30 -0400 Received: from [192.168.178.36] ([79.213.114.92]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LhNs4-1cEYCQ3jns-00mbgJ; Wed, 19 Apr 2017 15:11:07 +0200 Subject: Re: [PATCH] various: disallow --no-no-OPT for --no-opt options To: =?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Cc: Git Mailing List , Junio C Hamano , Jacob Keller References: <20170418170914.9701-1-avarab@gmail.com> From: =?UTF-8?Q?Ren=c3=a9_Scharfe?= Message-ID: Date: Wed, 19 Apr 2017 15:11:01 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:ODDrBm4Pc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QsAwlUfK9W6q i80qacX Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Am 19.04.2017 um 09:00 schrieb Ævar Arnfjörð Bjarmason: > On Wed, Apr 19, 2017 at 12:29 AM, René Scharfe wrote: >> Setting PARSE_OPT_NONEG takes away the ability to toggle the affected >> option. E.g. git clone would reject --checkout. Currently users can >> specify --no- options as defaults in aliases and override them on the >> command line if needed, with the patch that won't be possible anymore. >> >> PARSE_OPT_NONEG should only be used for options where a negation doesn't >> make sense, e.g. for the --stage option of checkout-index. > > That's a bad bug, I don't know whether to be surprised or not that we > had no tests for this :) > > I thought I was just disabling --no-no-checkout for --no-checkout, not > --checkout, but didn't notice the subtleties of the special case > handling for --no-* in parse-options.c, thanks. I'm confused. What's the bug here? --no-no-checkout is undocumented; Jacob's patch addresses it. --no-checkout is the documented form. Negation allows --checkout to be used as well, with the opposite meaning to --no-checkout. Turning off negation with PARSE_OPT_NONEG forbids --checkout to be used. Perhaps the issue is that a single line of documentation is not enough ("PARSE_OPT_NONEG: says that this option cannot be negated")? René