git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] templates: fix deprecated type option `--bool`

From
LGLucius Hu via GitGitGadget <gitgitgadget@gmail.com>
Date
Jan 19, 2020, 22:53 UTC
Message-ID
<pull.522.git.1579474412847.gitgitgadget@gmail.com>
From: Lucius Hu <orctarorga@gmail.com>

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`.

Signed-off-by: Lucius Hu <orctarorga@gmail.com>
---
    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(-)
diff --git a/templates/hooks--pre-commit.sample b/templates/hooks--pre-commit.sample
index 6a75641638..e144712c85 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 --bool hooks.allownonascii)
+allownonascii=$(git config --type=bool hooks.allownonascii)
 
 # Redirect output to stderr.
 exec 1>&2
diff --git a/templates/hooks--update.sample b/templates/hooks--update.sample
index 80ba94135c..5014c4b31c 100755
--- a/templates/hooks--update.sample
+++ b/templates/hooks--update.sample
@@ -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
-- 
gitgitgadget
Next: Junio C Hamano
Message 1 of 2 in “templates: fix deprecated type option `--bool`”
  1. templates: fix deprecated type option `--bool`Lucius Hu via GitGitGadget, Jan 19, 2020
  2. Junio C HamanoJan 24, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.