# [PATCH] t9001: use older Getopt::Long boolean prefix '--no' rather than '--no-'

3 messages from 2008-10-11 to 2008-10-11. Participants: Brandon Casey, Shawn O. Pearce.
Thread: https://gitlist.dev/t/15855

## Brandon Casey, 2008-10-11 00:21

Subject: [PATCH] t9001: use older Getopt::Long boolean prefix '--no' rather than '--no-'
Message-ID: <zAKaSrh5XLrzXloxZrj-A1EletXL_wuSGpTQgLXMT3MZYK_o3tUBfA@cipher.nrlssc.navy.mil>
URL: https://gitlist.dev/e/zAKaSrh5XLrzXloxZrj-A1EletXL_wuSGpTQgLXMT3MZYK_o3tUBfA%40cipher.nrlssc.navy.mil

```
Since dbf5e1e9, the '--no-validate' option is a Getopt::Long boolean
option. The '--no-' prefix (as in --no-validate) for boolean options
is not supported in Getopt::Long version 2.32 which was released with
Perl 5.8.0. This version only supports '--no' as in '--novalidate'.
More recent versions of Getopt::Long, such as version 2.34, support
either prefix. So use the older form in the tests.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 t/t9001-send-email.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index d098a01..561ae7d 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -109,7 +109,7 @@ test_expect_success 'allow long lines with --no-validate' '
 		--from="Example <nobody@example.com>" \
 		--to=nobody@example.com \
 		--smtp-server="$(pwd)/fake.sendmail" \
-		--no-validate \
+		--novalidate \
 		$patches longline.patch \
 		2>errors
 '
-- 
1.6.0.2.468.gd5b83

```

## Shawn O. Pearce, 2008-10-11 00:24

Subject: Re: [PATCH] t9001: use older Getopt::Long boolean prefix '--no' rather than '--no-'
Message-ID: <20081011002431.GK8203@spearce.org>
URL: https://gitlist.dev/e/20081011002431.GK8203%40spearce.org
In-Reply-To: <zAKaSrh5XLrzXloxZrj-A1EletXL_wuSGpTQgLXMT3MZYK_o3tUBfA@cipher.nrlssc.navy.mil>

```
Brandon Casey <casey@nrlssc.navy.mil> wrote:
> Since dbf5e1e9, the '--no-validate' option is a Getopt::Long boolean
> option. The '--no-' prefix (as in --no-validate) for boolean options
> is not supported in Getopt::Long version 2.32 which was released with
> Perl 5.8.0. This version only supports '--no' as in '--novalidate'.
> More recent versions of Getopt::Long, such as version 2.34, support
> either prefix. So use the older form in the tests.

Ouch.

Should we update our docs?

Actually, if 2.32 doesn't support the --no-validate syntax than
this is a regression in Git.  Even if it is what many would call a
bug in Getopt::Long in Perl, I think Git 1.6.1 should still honor
--no-validate like it did in Git 1.6.0.
 
> diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
> index d098a01..561ae7d 100755
> --- a/t/t9001-send-email.sh
> +++ b/t/t9001-send-email.sh
> @@ -109,7 +109,7 @@ test_expect_success 'allow long lines with --no-validate' '
>  		--from="Example <nobody@example.com>" \
>  		--to=nobody@example.com \
>  		--smtp-server="$(pwd)/fake.sendmail" \
> -		--no-validate \
> +		--novalidate \
>  		$patches longline.patch \
>  		2>errors
>  '

-- 
Shawn.

```

## Brandon Casey, 2008-10-11 00:44

Subject: Re: [PATCH] t9001: use older Getopt::Long boolean prefix '--no' rather than '--no-'
Message-ID: <h06qyD79DtpYDO2W32USeygrtpn8V6dBogiNd6y5wtPVgMNDGwbl4A@cipher.nrlssc.navy.mil>
URL: https://gitlist.dev/e/h06qyD79DtpYDO2W32USeygrtpn8V6dBogiNd6y5wtPVgMNDGwbl4A%40cipher.nrlssc.navy.mil
In-Reply-To: <20081011002431.GK8203@spearce.org>

```
Shawn O. Pearce wrote:
> Brandon Casey <casey@nrlssc.navy.mil> wrote:
>> Since dbf5e1e9, the '--no-validate' option is a Getopt::Long boolean
>> option. The '--no-' prefix (as in --no-validate) for boolean options
>> is not supported in Getopt::Long version 2.32 which was released with
>> Perl 5.8.0. This version only supports '--no' as in '--novalidate'.
>> More recent versions of Getopt::Long, such as version 2.34, support
>> either prefix. So use the older form in the tests.
> 
> Ouch.
> 
> Should we update our docs?
> 
> Actually, if 2.32 doesn't support the --no-validate syntax than
> this is a regression in Git.  Even if it is what many would call a
> bug in Getopt::Long in Perl, I think Git 1.6.1 should still honor
> --no-validate like it did in Git 1.6.0.

If it makes any difference, none of the other boolean options would
work in the documented '--no-' form either, such as --no-thread,
--no-signed-off-by-cc, etc.  '--no-validate' is probably the only one
that used to work.


Update the docs?

---[no-]validate::
+--[no-|no]validate::

hmm. not sure.

-brandon

```
