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

Re: Suppressing filter-branch warning

From
Elijah Newren <newren@gmail.com>
Date
Nov 6, 2020, 20:12 UTC
Message-ID
<CABPp-BGv9goqrYBwgSkmhPYOmwcXeRCzGT2sQbL+xD2xWeT5gQ@mail.gmail.com>
In-Reply-To
<xmqqo8kafjgt.fsf@gitster.c.googlers.com>
On Fri, Nov 6, 2020 at 10:06 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 54 quoted lines
>
> 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.

I agree with Junio that filter-branch's one-off nature means that not providing a configuration variable seems reasonable in this case. If someone else were to go to the effort of implementing some configuration option here, I wouldn't be that strongly against it, though I'd rather just let filter-branch lie dormant and stable.

A new command line option might have been better, but it didn't occur to me at the time this change was made and I hesitate to needlessly force people to adapt again.

Previous: Junio C HamanoNext: Daniel Höpfl
Message 3 of 5 in “Suppressing filter-branch warning”
  1. Daniel HöpflNov 6, 2020
  2. Junio C HamanoNov 6, 2020
  3. Elijah NewrenNov 6, 2020
  4. Daniel HöpflNov 10, 2020
  5. Johannes SchindelinNov 10, 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.