Skip to contentSkip to conversation

templates: fix deprecated type option `--bool`

PATCH In review Lucius Hu via GitGitGadget 2 participants 2 messages Jan 19, 2020 – Jan 24, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 templates: fix deprecated type option `--bool`

From: Lucius Hu <[email protected]>

The --bool option to git-config is marked as historical, and users are recommended to use --type=bool instead. This commit replaces all occurrences of --bool in the templates.

Also note that, no other deprecated type options are found, including --int, --bool-or-int, --path, or --expiry-date.

---
templates: Fix depracated type option --bool

The --bool option to git-config is marked as historical, and users are recommended to use --type=bool instead. This commit replaces all occurrences of --bool in the templates.

Also note that, no other depracated type options are found, including --int,--bool-or-int, --path, or --expiry-date.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-522%2Flebensterben%2Fmaster-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-522/lebensterben/master-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/522

 templates/hooks--pre-commit.sample |  2 +-
 templates/hooks--update.sample     | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)
templates/hooks--pre-commit.sample +1 -1
index 6a75641638..e144712c85 100755
@@ -16,7 +16,7 @@ else
 fi
 
 # If you want to allow non-ASCII filenames set this variable to true.
-allownonascii=$(git config --bool hooks.allownonascii)
+allownonascii=$(git config --type=bool hooks.allownonascii)
 
 # Redirect output to stderr.
 exec 1>&2
templates/hooks--update.sample +5 -5
index 80ba94135c..5014c4b31c 100755
@@ -43,11 +43,11 @@ if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
 fi
 
 # --- Config
-allowunannotated=$(git config --bool hooks.allowunannotated)
-allowdeletebranch=$(git config --bool hooks.allowdeletebranch)
-denycreatebranch=$(git config --bool hooks.denycreatebranch)
-allowdeletetag=$(git config --bool hooks.allowdeletetag)
-allowmodifytag=$(git config --bool hooks.allowmodifytag)
+allowunannotated=$(git config --type=bool hooks.allowunannotated)
+allowdeletebranch=$(git config --type=bool hooks.allowdeletebranch)
+denycreatebranch=$(git config --type=bool hooks.denycreatebranch)
+allowdeletetag=$(git config --type=bool hooks.allowdeletetag)
+allowmodifytag=$(git config --type=bool hooks.allowmodifytag)
 
 # check for no description
 projectdesc=$(sed -e '1q' "$GIT_DIR/description")

base-commit: 7a6a90c6ec48fc78c83d7090d6c1b95d8f3739c0

Signature · 1 line
gitgitgadget
#1 lore raw
Quoted 13 lines · Lucius Hu via GitGitGadget

From: Lucius Hu <[email protected]>

The --bool option to git-config is marked as historical, and users are recommended to use --type=bool instead. This commit replaces all occurrences of --bool in the templates.

Also note that, no other deprecated type options are found, including --int, --bool-or-int, --path, or --expiry-date.

---
templates: Fix depracated type option --bool

Quoted 6 lines

The --bool option to git-config is marked as historical, and users are recommended to use --type=bool instead. This commit replaces all occurrences of --bool in the templates.

Also note that, no other depracated type options are found, including --int,--bool-or-int, --path, or --expiry-date.

That's a bit redundant but I suspect it is not Lucius's fault ;-)

Quoted 14 lines

# If you want to allow non-ASCII filenames set this variable to true.

templates/hooks--pre-commit.sample +1 -1
-allownonascii=$(git config --bool hooks.allownonascii)
+allownonascii=$(git config --type=bool hooks.allownonascii)
 
 # Redirect output to stderr.
 exec 1>&2
templates/hooks--update.sample +0 -0
index 80ba94135c..5014c4b31c 100755
@@ -43,11 +43,11 @@ if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
 fi
 
 # --- Config

templates/hooks--update.sample if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then · line 50

Quoted 10 lines
templates/hooks--update.sample +5 -5
-allowunannotated=$(git config --bool hooks.allowunannotated)
-allowdeletebranch=$(git config --bool hooks.allowdeletebranch)
-denycreatebranch=$(git config --bool hooks.denycreatebranch)
-allowdeletetag=$(git config --bool hooks.allowdeletetag)
-allowmodifytag=$(git config --bool hooks.allowmodifytag)
+allowunannotated=$(git config --type=bool hooks.allowunannotated)
+allowdeletebranch=$(git config --type=bool hooks.allowdeletebranch)
+denycreatebranch=$(git config --type=bool hooks.denycreatebranch)
+allowdeletetag=$(git config --type=bool hooks.allowdeletetag)
+allowmodifytag=$(git config --type=bool hooks.allowmodifytag)

OK.

Quoted 4 lines
templates/hooks--update.sample +0 -0
 # check for no description
 projectdesc=$(sed -e '1q' "$GIT_DIR/description")
 

base-commit: 7a6a90c6ec48fc78c83d7090d6c1b95d8f3739c0

Offtopic. This is probably what GGG added, but can we hide it behind the "-- " marker?