Re: [PATCH] various: disallow --no-no-OPT for --no-opt options

2017-04-19 Thread Jeff King
On Wed, Apr 19, 2017 at 09:02:52AM +0200, Ævar Arnfjörð Bjarmason wrote: > On Wed, Apr 19, 2017 at 4:50 AM, Jeff King wrote: > > On Tue, Apr 18, 2017 at 07:40:37PM -0700, Junio C Hamano wrote: > > > >> > It might even be possible to detect the existing line and > >> > have parse-options automatic

Re: [PATCH] various: disallow --no-no-OPT for --no-opt options

2017-04-19 Thread René Scharfe
Am 19.04.2017 um 15:19 schrieb Ævar Arnfjörð Bjarmason: I mean a bug in my patch, i.e. I meant to remove --no-no-OPT in cases of --no-OPT but also removed --OPT unintentionally, but anyway, let's drop this one, Jacob's patch is better. Ah, OK. You also wondered why no tests complained. Good q

Re: [PATCH] various: disallow --no-no-OPT for --no-opt options

2017-04-19 Thread Ævar Arnfjörð Bjarmason
On Wed, Apr 19, 2017 at 3:11 PM, René Scharfe wrote: > 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 --check

Re: [PATCH] various: disallow --no-no-OPT for --no-opt options

2017-04-19 Thread René Scharfe
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

Re: [PATCH] various: disallow --no-no-OPT for --no-opt options

2017-04-19 Thread Jacob Keller
On Wed, Apr 19, 2017 at 12:02 AM, Ævar Arnfjörð Bjarmason wrote: > On Wed, Apr 19, 2017 at 4:50 AM, Jeff King wrote: >> On Tue, Apr 18, 2017 at 07:40:37PM -0700, Junio C Hamano wrote: >> >>> > It might even be possible to detect the existing line and >>> > have parse-options automatically respect

Re: [PATCH] various: disallow --no-no-OPT for --no-opt options

2017-04-19 Thread Ævar Arnfjörð Bjarmason
On Wed, Apr 19, 2017 at 4:50 AM, Jeff King wrote: > On Tue, Apr 18, 2017 at 07:40:37PM -0700, Junio C Hamano wrote: > >> > It might even be possible to detect the existing line and >> > have parse-options automatically respect "--foo" when "--no-foo" is >> > present. But that may run afoul of cal

Re: [PATCH] various: disallow --no-no-OPT for --no-opt options

2017-04-19 Thread Ævar Arnfjörð Bjarmason
On Wed, Apr 19, 2017 at 12:29 AM, René Scharfe wrote: > Am 18.04.2017 um 19:09 schrieb Ævar Arnfjörð Bjarmason: >> >> Change various --no-OPT options which don't supply PARSE_OPT_NONEG to >> make --no-no-OPT an error. >> >> All of these worked before this change, e.g. doing cloning by doing >> "gi

Re: [PATCH] various: disallow --no-no-OPT for --no-opt options

2017-04-18 Thread Jeff King
On Tue, Apr 18, 2017 at 07:40:37PM -0700, Junio C Hamano wrote: > > It might even be possible to detect the existing line and > > have parse-options automatically respect "--foo" when "--no-foo" is > > present. But that may run afoul of callers that add both "--foo" and > > "--no-foo" manually. >

Re: [PATCH] various: disallow --no-no-OPT for --no-opt options

2017-04-18 Thread Junio C Hamano
Jeff King writes: > On Wed, Apr 19, 2017 at 12:29:18AM +0200, René Scharfe wrote: > ... >> 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. > > I think we do strive to avoid "--no-no-foo", and instead have "--no

Re: [PATCH] various: disallow --no-no-OPT for --no-opt options

2017-04-18 Thread Jeff King
On Wed, Apr 19, 2017 at 12:29:18AM +0200, René Scharfe wrote: > Am 18.04.2017 um 19:09 schrieb Ævar Arnfjörð Bjarmason: > > Change various --no-OPT options which don't supply PARSE_OPT_NONEG to > > make --no-no-OPT an error. > > > > All of these worked before this change, e.g. doing cloning by do

Re: [PATCH] various: disallow --no-no-OPT for --no-opt options

2017-04-18 Thread René Scharfe
Am 18.04.2017 um 19:09 schrieb Ævar Arnfjörð Bjarmason: Change various --no-OPT options which don't supply PARSE_OPT_NONEG to make --no-no-OPT an error. All of these worked before this change, e.g. doing cloning by doing "git clone --no-no-checkout" is equivalent to just "git clone", but this wa

[PATCH] various: disallow --no-no-OPT for --no-opt options

2017-04-18 Thread Ævar Arnfjörð Bjarmason
Change various --no-OPT options which don't supply PARSE_OPT_NONEG to make --no-no-OPT an error. All of these worked before this change, e.g. doing cloning by doing "git clone --no-no-checkout" is equivalent to just "git clone", but this was never intended, and is inconsistent with other --no-OPT