threads / patch / 35004

patchsample pre-commit hook: Use --bool when retrieving config var

Subject: [PATCH] sample pre-commit hook: Use --bool when retrieving config var

## tl;dr

3 messages between Sep 24, 2013 and Sep 25, 2013. Diffs are folded; open one to read it.

replies: 2people: 2as markdown or json

Johan Herland· Sep 24, 2013, 07:52 UTC · lore
Signed-off-by: Johan Herland <johan@herland.net>
---
Resend/reminder...
...Johan
 templates/hooks--pre-commit.sample | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to templates/hooks--pre-commit.sample +1 −1
diff --git a/templates/hooks--pre-commit.sample b/templates/hooks--pre-commit.sample
index 586e3bf..68d62d5 100755
--- a/templates/hooks--pre-commit.sample
+++ b/templates/hooks--pre-commit.sample
@@ -16,7 +16,7 @@ else
 fi
 
 # If you want to allow non-ASCII filenames set this variable to true.
-allownonascii=$(git config hooks.allownonascii)
+allownonascii=$(git config --bool hooks.allownonascii)
 
 # Redirect output to stderr.
 exec 1>&2
-- 
1.8.1.rc2.269.g5aaac94
Jonathan Nieder· Sep 24, 2013, 19:22 UTC · re: Johan Herland · lore

Re: [PATCH] sample pre-commit hook: Use --bool when retrieving config var

Johan Herland wrote:
> Signed-off-by: Johan Herland <johan@herland.net>
Thanks.
What symptoms does this alleviate?  Is this to allow configurations like
	[hooks]
		allowNonAscii = 1
and
	[hooks]
		allowNonAscii
		
to do the expected thing, or is it something more subtle than that?

Curious, Jonathan

Johan Herland· Sep 25, 2013, 10:10 UTC · re: Jonathan Nieder · lore

Re: [PATCH] sample pre-commit hook: Use --bool when retrieving config var

On Tue, Sep 24, 2013 at 9:22 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 16 quoted lines
> Johan Herland wrote:
>> Signed-off-by: Johan Herland <johan@herland.net>
>
> Thanks.
>
> What symptoms does this alleviate?  Is this to allow configurations like
>
>         [hooks]
>                 allowNonAscii = 1
>
> and
>
>         [hooks]
>                 allowNonAscii
>
> to do the expected thing, or is it something more subtle than that?

Nothing subtle. Just what you list. And for consistency with the other sample hooks' use of "git config".

...Johan
-- 
Johan Herland, <johan@herland.net>
www.herland.net

← back to recent threads