# why no mention of "hooks.allownonascii" in any man page?

4 messages from 2019-02-19 to 2019-02-19. Participants: Robert P. J. Day, Ævar Arnfjörð Bjarmason, Junio C Hamano.
Thread: https://gitlist.dev/t/50539

## Robert P. J. Day, 2019-02-19 10:48

Subject: why no mention of "hooks.allownonascii" in any man page?
Message-ID: <alpine.LFD.2.21.1902190544470.23739@localhost.localdomain>
URL: https://gitlist.dev/e/alpine.LFD.2.21.1902190544470.23739%40localhost.localdomain

```

  was just perusing the sample hook scripts, and the sample pre-commit
script provided with git does the following check:

# If you want to allow non-ASCII filenames set this variable to true.
allownonascii=$(git config --bool hooks.allownonascii)

  but that config variable (hooks.allownonascii) is not mentioned in
any man page. its entire existence in the git code base consists of:

$ grep -r allownonascii *
templates/hooks--pre-commit.sample:allownonascii=$(git config --bool hooks.allownonascii)
templates/hooks--pre-commit.sample:if [ "$allownonascii" != "true" ] &&
templates/hooks--pre-commit.sample:  git config hooks.allownonascii true

  technically, there's nothing wrong with that, i just thought it was
a bit weird that a sample hook script refers to a config variable that
is not referred to in any way elsewhere.

  should i care?

rday

```

## Ævar Arnfjörð Bjarmason, 2019-02-19 11:23

Subject: Re: why no mention of "hooks.allownonascii" in any man page?
Message-ID: <87mums58f2.fsf@evledraar.gmail.com>
URL: https://gitlist.dev/e/87mums58f2.fsf%40evledraar.gmail.com
In-Reply-To: <alpine.LFD.2.21.1902190544470.23739@localhost.localdomain>

```

On Tue, Feb 19 2019, Robert P. J. Day wrote:

>   was just perusing the sample hook scripts, and the sample pre-commit
> script provided with git does the following check:
>
> # If you want to allow non-ASCII filenames set this variable to true.
> allownonascii=$(git config --bool hooks.allownonascii)
>
>   but that config variable (hooks.allownonascii) is not mentioned in
> any man page. its entire existence in the git code base consists of:
>
> $ grep -r allownonascii *
> templates/hooks--pre-commit.sample:allownonascii=$(git config --bool hooks.allownonascii)
> templates/hooks--pre-commit.sample:if [ "$allownonascii" != "true" ] &&
> templates/hooks--pre-commit.sample:  git config hooks.allownonascii true
>
>   technically, there's nothing wrong with that, i just thought it was
> a bit weird that a sample hook script refers to a config variable that
> is not referred to in any way elsewhere.

The hook itself spontaneously introduces it and uses it. There's nothing
magical about config variable, e.g. it could also be "xyz.abc" instead
of "hooks.allownonascii".

But perhaps it should be documented as the functionality of the default
hook in githooks(5), similarly to how we document
hooks.allowunannotated. Patches welcome :)

```

## Robert P. J. Day, 2019-02-19 11:38

Subject: Re: why no mention of "hooks.allownonascii" in any man page?
Message-ID: <alpine.LFD.2.21.1902190629490.25090@localhost.localdomain>
URL: https://gitlist.dev/e/alpine.LFD.2.21.1902190629490.25090%40localhost.localdomain
In-Reply-To: <87mums58f2.fsf@evledraar.gmail.com>

```
On Tue, 19 Feb 2019, Ævar Arnfjörð Bjarmason wrote:

>
> On Tue, Feb 19 2019, Robert P. J. Day wrote:
>
> >   was just perusing the sample hook scripts, and the sample pre-commit
> > script provided with git does the following check:
> >
> > # If you want to allow non-ASCII filenames set this variable to true.
> > allownonascii=$(git config --bool hooks.allownonascii)
> >
> >   but that config variable (hooks.allownonascii) is not mentioned in
> > any man page. its entire existence in the git code base consists of:
> >
> > $ grep -r allownonascii *
> > templates/hooks--pre-commit.sample:allownonascii=$(git config --bool hooks.allownonascii)
> > templates/hooks--pre-commit.sample:if [ "$allownonascii" != "true" ] &&
> > templates/hooks--pre-commit.sample:  git config hooks.allownonascii true
> >
> >   technically, there's nothing wrong with that, i just thought it was
> > a bit weird that a sample hook script refers to a config variable that
> > is not referred to in any way elsewhere.
>
> The hook itself spontaneously introduces it and uses it. There's
> nothing magical about config variable, e.g. it could also be
> "xyz.abc" instead of "hooks.allownonascii".
>
> But perhaps it should be documented as the functionality of the
> default hook in githooks(5), similarly to how we document
> hooks.allowunannotated. Patches welcome :)

  sure, i'll take care of that.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                  http://crashcourse.ca/dokuwiki

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
```

## Junio C Hamano, 2019-02-19 19:41

Subject: Re: why no mention of "hooks.allownonascii" in any man page?
Message-ID: <xmqqftsj1s7y.fsf@gitster-ct.c.googlers.com>
URL: https://gitlist.dev/e/xmqqftsj1s7y.fsf%40gitster-ct.c.googlers.com
In-Reply-To: <alpine.LFD.2.21.1902190629490.25090@localhost.localdomain>

```
"Robert P. J. Day" <rpjday@crashcourse.ca> writes:

>> But perhaps it should be documented as the functionality of the
>> default hook in githooks(5), similarly to how we document
>> hooks.allowunannotated. Patches welcome :)
>
>   sure, i'll take care of that.

Sounds like a sensible way forward.  Thanks, both.

```
