git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Elijah Newren <newren@gmail.com>
Cc: git@vger.kernel.org, "Daniel Höpfl" <daniel@hoepfl.de>
Subject: Re: Suppressing filter-branch warning
Date: Fri, 06 Nov 2020 10:06:42 -0800	[thread overview]
Message-ID: <xmqqo8kafjgt.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <20201106090443.GA20407@black.spass-am-geraet.de> ("Daniel =?utf-8?Q?H=C3=B6pfl=22's?= message of "Fri, 6 Nov 2020 10:04:43 +0100")

Daniel Höpfl <daniel@hoepfl.de> writes:

> Hello there,
>
> What did you do before the bug happened? (Steps to reproduce your issue)
> git filter-branch -f --env-filter '' --tag-name-filter cat -- HEAD
>
> What did you expect to happen? (Expected behavior)
> See below (difference).
>
> What happened instead? (Actual behavior)
> When using git filter-branch, the following message is shown:
>
> ----------8<-----------------------------------------------------
> WARNING: git-filter-branch has a glut of gotchas generating mangled history
>         rewrites.  Hit Ctrl-C before proceeding to abort, then use an
>         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.
> ----------8<-----------------------------------------------------
>
> You can suppress this by setting the environment variable shown.
>
> What's different between what you expected and what actually happened?
>
> Normally, when git introduces this kind of change, there is a
> git config variable that one can set to suppress it.
> That way one has fine grade control when to suppress it (one repo only...globally).

I think this comes from 9df53c5d (Recommend git-filter-repo instead
of git-filter-branch, 2019-09-04).  

FWIW, I personally do not think an environment is a worse choice
over configuration variable in this particular case.  The large
scale rewriting of the entire history in the repository by its
nature is an one-off operation that ought to happen only rarely,
so a one-shot

	$ FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch ...

that reminds the user every time would be more appropriate than a
configuration variable that has a more permanent squelching effect.

If it were a new command line option may have been even better, as
an environment variable can be defined in .*rc and forgotten, but a
command line option needs to be typed every time and would serve as
a better reminder (yes, I know it can also be aliased away, so it
may not make much practical difference either way).

But I'll let the author of the feature to comment.

Thanks.

  reply	other threads:[~2020-11-06 18:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-06  9:04 Daniel Höpfl
2020-11-06 18:06 ` Junio C Hamano [this message]
2020-11-06 20:12   ` Elijah Newren
2020-11-10 11:21     ` Daniel Höpfl
2020-11-10 12:15       ` Johannes Schindelin

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqo8kafjgt.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=daniel@hoepfl.de \
    --cc=git@vger.kernel.org \
    --cc=newren@gmail.com \
    --subject='Re: Suppressing filter-branch warning' \
    /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

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).