git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel Höpfl via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: "Daniel Höpfl" <github@hoepfl.de>, "Daniel Höpfl" <daniel@hoepfl.de>
Subject: [PATCH] Add config variable besides env variable to squelch "do-not-use" warning.
Date: Tue, 15 Jun 2021 19:38:33 +0000	[thread overview]
Message-ID: <pull.912.git.git.1623785914202.gitgitgadget@gmail.com> (raw)

From: =?UTF-8?q?Daniel=20H=C3=B6pfl?= <daniel@hoepfl.de>

In addition to the environment variable FILTER_BRANCH_SQUELCH_WARNING,
the git config filter-branch.squelchWarning is checked to see if the
usage warning should be squelched.

Signed-off-by: Daniel Höpfl <daniel@hoepfl.de>
---
    Add filter-branch.squelchWarning git config alongside
    FILTER_BRANCH_SQUELCH_WARNING
    
    In addition to the environment variable FILTER_BRANCH_SQUELCH_WARNING,
    the git config filter-branch.squelchWarning is checked to see if the
    usage warning should be squelched.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-912%2Fdhoepfl%2FFILTER_BRANCH_SQUELCH_WARNING-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-912/dhoepfl/FILTER_BRANCH_SQUELCH_WARNING-v1
Pull-Request: https://github.com/git/git/pull/912

 git-filter-branch.sh | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index fea796461721..d33db14a2a84 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -83,7 +83,8 @@ set_ident () {
 	finish_ident COMMITTER
 }
 
-if test -z "$FILTER_BRANCH_SQUELCH_WARNING$GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS"
+if test -z "$FILTER_BRANCH_SQUELCH_WARNING$GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS" &&
+   test "$(git config --bool filter-branch.squelchWarning)" != true
 then
 	cat <<EOF
 WARNING: git-filter-branch has a glut of gotchas generating mangled history
@@ -91,7 +92,12 @@ WARNING: git-filter-branch has a glut of gotchas generating mangled history
 	 alternative filtering tool such as 'git filter-repo'
 	 (https://github.com/newren/git-filter-repo/) instead.  See the
 	 filter-branch manual page for more details; to squelch this warning,
-	 set FILTER_BRANCH_SQUELCH_WARNING=1.
+	 set FILTER_BRANCH_SQUELCH_WARNING=1 or run the following command:
+
+	    git config filter-branch.squelchWarning true
+
+	 You can replace "git config" with "git config --global" to disable
+	 the warning for all repositories.
 EOF
 	sleep 10
 	printf "Proceeding with filter-branch...\n\n"

base-commit: e4d83eee9239207622e2b1cc43967da5051c189c
-- 
gitgitgadget

             reply	other threads:[~2021-06-15 19:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-15 19:38 Daniel Höpfl via GitGitGadget [this message]
2021-06-16  4:23 ` [PATCH] Add config variable besides env variable to squelch "do-not-use" warning Junio C Hamano
2021-06-16  8:03   ` Elijah Newren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.912.git.git.1623785914202.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=daniel@hoepfl.de \
    --cc=git@vger.kernel.org \
    --cc=github@hoepfl.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).