{"thread":{"id":"54588","subject":"Suppressing filter-branch warning","startedAt":"2020-11-06T09:12:47Z","lastAt":"2020-11-10T12:15:12Z","messageCount":5,"participants":["Daniel Höpfl","Junio C Hamano","Elijah Newren","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"409270","messageId":"20201106090443.GA20407@black.spass-am-geraet.de","threadId":"54588","inReplyTo":null,"subject":"Suppressing filter-branch warning","fromName":"Daniel Höpfl","fromEmail":"daniel@hoepfl.de","sentAt":"2020-11-06T09:04:43Z","receivedAt":"2020-11-06T09:12:47Z","isPatch":false,"sender":{"key":"daniel@hoepfl.de","avatar":null},"body":"Hello there,\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\ngit filter-branch -f --env-filter '' --tag-name-filter cat -- HEAD\n\nWhat did you expect to happen? (Expected behavior)\nSee below (difference).\n\nWhat happened instead? (Actual behavior)\nWhen using git filter-branch, the following message is shown:\n\n----------8<-----------------------------------------------------\nWARNING: git-filter-branch has a glut of gotchas generating mangled history\n         rewrites.  Hit Ctrl-C before proceeding to abort, then use an\n         alternative filtering tool such as 'git filter-repo'\n         (https://github.com/newren/git-filter-repo/) instead.  See the\n         filter-branch manual page for more details; to squelch this warning,\n         set FILTER_BRANCH_SQUELCH_WARNING=1.\n----------8<-----------------------------------------------------\n\nYou can suppress this by setting the environment variable shown.\n\nWhat's different between what you expected and what actually happened?\n\nNormally, when git introduces this kind of change, there is a\ngit config variable that one can set to suppress it.\nThat way one has fine grade control when to suppress it (one repo only...globally).\n\nAnything else you want to add:\n\n-/-\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.29.0\ncpu: x86_64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nuname: Linux 4.19.0-10-amd64 #1 SMP Debian 4.19.132-1 (2020-07-24) x86_64\ncompiler info: gnuc: 8.3\nlibc info: glibc: 2.28\n$SHELL (typically, interactive shell): /bin/bash\n\n"},{"id":"409282","messageId":"xmqqo8kafjgt.fsf@gitster.c.googlers.com","threadId":"54588","inReplyTo":"20201106090443.GA20407@black.spass-am-geraet.de","subject":"Re: Suppressing filter-branch warning","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-11-06T18:06:42Z","receivedAt":"2020-11-06T18:06:52Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Daniel Höpfl <daniel@hoepfl.de> writes:\n\n> Hello there,\n>\n> What did you do before the bug happened? (Steps to reproduce your issue)\n> git filter-branch -f --env-filter '' --tag-name-filter cat -- HEAD\n>\n> What did you expect to happen? (Expected behavior)\n> See below (difference).\n>\n> What happened instead? (Actual behavior)\n> When using git filter-branch, the following message is shown:\n>\n> ----------8<-----------------------------------------------------\n> WARNING: git-filter-branch has a glut of gotchas generating mangled history\n>         rewrites.  Hit Ctrl-C before proceeding to abort, then use an\n>         alternative filtering tool such as 'git filter-repo'\n>         (https://github.com/newren/git-filter-repo/) instead.  See the\n>         filter-branch manual page for more details; to squelch this warning,\n>         set FILTER_BRANCH_SQUELCH_WARNING=1.\n> ----------8<-----------------------------------------------------\n>\n> You can suppress this by setting the environment variable shown.\n>\n> What's different between what you expected and what actually happened?\n>\n> Normally, when git introduces this kind of change, there is a\n> git config variable that one can set to suppress it.\n> That way one has fine grade control when to suppress it (one repo only...globally).\n\nI think this comes from 9df53c5d (Recommend git-filter-repo instead\nof git-filter-branch, 2019-09-04).  \n\nFWIW, I personally do not think an environment is a worse choice\nover configuration variable in this particular case.  The large\nscale rewriting of the entire history in the repository by its\nnature is an one-off operation that ought to happen only rarely,\nso a one-shot\n\n\t$ FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch ...\n\nthat reminds the user every time would be more appropriate than a\nconfiguration variable that has a more permanent squelching effect.\n\nIf it were a new command line option may have been even better, as\nan environment variable can be defined in .*rc and forgotten, but a\ncommand line option needs to be typed every time and would serve as\na better reminder (yes, I know it can also be aliased away, so it\nmay not make much practical difference either way).\n\nBut I'll let the author of the feature to comment.\n\nThanks.\n"},{"id":"409294","messageId":"CABPp-BGv9goqrYBwgSkmhPYOmwcXeRCzGT2sQbL+xD2xWeT5gQ@mail.gmail.com","threadId":"54588","inReplyTo":"xmqqo8kafjgt.fsf@gitster.c.googlers.com","subject":"Re: Suppressing filter-branch warning","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2020-11-06T20:12:55Z","receivedAt":"2020-11-06T20:13:10Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Fri, Nov 6, 2020 at 10:06 AM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Daniel Höpfl <daniel@hoepfl.de> writes:\n>\n> > Hello there,\n> >\n> > What did you do before the bug happened? (Steps to reproduce your issue)\n> > git filter-branch -f --env-filter '' --tag-name-filter cat -- HEAD\n> >\n> > What did you expect to happen? (Expected behavior)\n> > See below (difference).\n> >\n> > What happened instead? (Actual behavior)\n> > When using git filter-branch, the following message is shown:\n> >\n> > ----------8<-----------------------------------------------------\n> > WARNING: git-filter-branch has a glut of gotchas generating mangled history\n> >         rewrites.  Hit Ctrl-C before proceeding to abort, then use an\n> >         alternative filtering tool such as 'git filter-repo'\n> >         (https://github.com/newren/git-filter-repo/) instead.  See the\n> >         filter-branch manual page for more details; to squelch this warning,\n> >         set FILTER_BRANCH_SQUELCH_WARNING=1.\n> > ----------8<-----------------------------------------------------\n> >\n> > You can suppress this by setting the environment variable shown.\n> >\n> > What's different between what you expected and what actually happened?\n> >\n> > Normally, when git introduces this kind of change, there is a\n> > git config variable that one can set to suppress it.\n> > That way one has fine grade control when to suppress it (one repo only...globally).\n>\n> I think this comes from 9df53c5d (Recommend git-filter-repo instead\n> of git-filter-branch, 2019-09-04).\n>\n> FWIW, I personally do not think an environment is a worse choice\n> over configuration variable in this particular case.  The large\n> scale rewriting of the entire history in the repository by its\n> nature is an one-off operation that ought to happen only rarely,\n> so a one-shot\n>\n>         $ FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch ...\n>\n> that reminds the user every time would be more appropriate than a\n> configuration variable that has a more permanent squelching effect.\n>\n> If it were a new command line option may have been even better, as\n> an environment variable can be defined in .*rc and forgotten, but a\n> command line option needs to be typed every time and would serve as\n> a better reminder (yes, I know it can also be aliased away, so it\n> may not make much practical difference either way).\n>\n> But I'll let the author of the feature to comment.\n>\n> Thanks.\n\nI agree with Junio that filter-branch's one-off nature means that not\nproviding a configuration variable seems reasonable in this case.  If\nsomeone else were to go to the effort of implementing some\nconfiguration option here, I wouldn't be that strongly against it,\nthough I'd rather just let filter-branch lie dormant and stable.\n\nA new command line option might have been better, but it didn't occur\nto me at the time this change was made and I hesitate to needlessly\nforce people to adapt again.\n"},{"id":"409471","messageId":"20201110112114.GA28702@black.spass-am-geraet.de","threadId":"54588","inReplyTo":"CABPp-BGv9goqrYBwgSkmhPYOmwcXeRCzGT2sQbL+xD2xWeT5gQ@mail.gmail.com","subject":"Re: Suppressing filter-branch warning","fromName":"Daniel Höpfl","fromEmail":"daniel@hoepfl.de","sentAt":"2020-11-10T11:21:14Z","receivedAt":"2020-11-10T11:21:31Z","isPatch":false,"sender":{"key":"daniel@hoepfl.de","avatar":null},"body":"Hallo Elijah,\n\nOn Fri, Nov 06, 2020 at 12:12:55PM -0800, Elijah Newren wrote:\n>On Fri, Nov 6, 2020 at 10:06 AM Junio C Hamano <gitster@pobox.com> wrote:\n>>\n>> Daniel Höpfl <daniel@hoepfl.de> writes:\n>>\n>> > Hello there,\n>> >\n>> > What did you do before the bug happened? (Steps to reproduce your issue)\n>> > git filter-branch -f --env-filter '' --tag-name-filter cat -- HEAD\n>> >\n>> > What did you expect to happen? (Expected behavior)\n>> > See below (difference).\n>> >\n>> > What happened instead? (Actual behavior)\n>> > When using git filter-branch, the following message is shown:\n>> >\n>> > ----------8<-----------------------------------------------------\n>> > WARNING: git-filter-branch has a glut of gotchas generating mangled history\n>> >         rewrites.  Hit Ctrl-C before proceeding to abort, then use an\n>> >         alternative filtering tool such as 'git filter-repo'\n>> >         (https://github.com/newren/git-filter-repo/) instead.  See the\n>> >         filter-branch manual page for more details; to squelch this warning,\n>> >         set FILTER_BRANCH_SQUELCH_WARNING=1.\n>> > ----------8<-----------------------------------------------------\n>> >\n>> > You can suppress this by setting the environment variable shown.\n>> >\n>> > What's different between what you expected and what actually happened?\n>> >\n>> > Normally, when git introduces this kind of change, there is a\n>> > git config variable that one can set to suppress it.\n>> > That way one has fine grade control when to suppress it (one repo only...globally).\n>>\n>> I think this comes from 9df53c5d (Recommend git-filter-repo instead\n>> of git-filter-branch, 2019-09-04).\n>>\n>> FWIW, I personally do not think an environment is a worse choice\n>> over configuration variable in this particular case.  The large\n>> scale rewriting of the entire history in the repository by its\n>> nature is an one-off operation that ought to happen only rarely,\n>> so a one-shot\n>>\n>>         $ FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch ...\n>>\n>> that reminds the user every time would be more appropriate than a\n>> configuration variable that has a more permanent squelching effect.\n>>\n>> If it were a new command line option may have been even better, as\n>> an environment variable can be defined in .*rc and forgotten, but a\n>> command line option needs to be typed every time and would serve as\n>> a better reminder (yes, I know it can also be aliased away, so it\n>> may not make much practical difference either way).\n>>\n>> But I'll let the author of the feature to comment.\n>>\n>> Thanks.\n>\n>I agree with Junio that filter-branch's one-off nature means that not\n>providing a configuration variable seems reasonable in this case.  If\n>someone else were to go to the effort of implementing some\n>configuration option here, I wouldn't be that strongly against it,\n>though I'd rather just let filter-branch lie dormant and stable.\n>\n>A new command line option might have been better, but it didn't occur\n>to me at the time this change was made and I hesitate to needlessly\n>force people to adapt again.\n\nI implemented the change and sent a pull request on github (#912) but failed at GitGitGadget. Anyways, here’s the patch:\n\n---\n git-filter-branch.sh | 14 ++++++++++----\n 1 file changed, 10 insertions(+), 4 deletions(-)\n\ndiff --git a/git-filter-branch.sh b/git-filter-branch.sh\nindex fea7964617..fb55afcc86 100755\n--- a/git-filter-branch.sh\n+++ b/git-filter-branch.sh\n@@ -83,15 +83,21 @@ set_ident () {\n        finish_ident COMMITTER\n }\n\n-if test -z \"$FILTER_BRANCH_SQUELCH_WARNING$GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS\"\n+if test -z \"$FILTER_BRANCH_SQUELCH_WARNING$GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS\" && \\\n+   test \"$(git config --bool filter-branch.squelchWarning)\" != true\n then\n        cat <<EOF\n WARNING: git-filter-branch has a glut of gotchas generating mangled history\n-        rewrites.  Hit Ctrl-C before proceeding to abort, then use an\n+        rewrites. Hit Ctrl-C before proceeding to abort, then use an\n         alternative filtering tool such as 'git filter-repo'\n-        (https://github.com/newren/git-filter-repo/) instead.  See the\n+        (https://github.com/newren/git-filter-repo/) instead. See the\n         filter-branch manual page for more details; to squelch this warning,\n-        set FILTER_BRANCH_SQUELCH_WARNING=1.\n+         set FILTER_BRANCH_SQUELCH_WARNING=1 or run the following command:\n+\n+           git config filter-branch.squelchWarning true\n+\n+         You can replace \"git config\" with \"git config --global\" to disable\n+         the warning for all repositories.\n EOF\n        sleep 10\n        printf \"Proceeding with filter-branch...\\n\\n\"\n--\n2.29.0\n\n\n"},{"id":"409479","messageId":"nycvar.QRO.7.76.6.2011101311170.18437@tvgsbejvaqbjf.bet","threadId":"54588","inReplyTo":"20201110112114.GA28702@black.spass-am-geraet.de","subject":"Re: Suppressing filter-branch warning","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-11-10T12:15:00Z","receivedAt":"2020-11-10T12:15:12Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Daniel,\n\nOn Tue, 10 Nov 2020, Daniel Höpfl wrote:\n\n> Hallo Elijah,\n>\n> On Fri, Nov 06, 2020 at 12:12:55PM -0800, Elijah Newren wrote:\n> >On Fri, Nov 6, 2020 at 10:06 AM Junio C Hamano <gitster@pobox.com> wrote:\n> > >\n> > > Daniel Höpfl <daniel@hoepfl.de> writes:\n> > >\n> > > > Hello there,\n> > > >\n> > > > What did you do before the bug happened? (Steps to reproduce your issue)\n> > > > git filter-branch -f --env-filter '' --tag-name-filter cat -- HEAD\n> > > >\n> > > > What did you expect to happen? (Expected behavior)\n> > > > See below (difference).\n> > > >\n> > > > What happened instead? (Actual behavior)\n> > > > When using git filter-branch, the following message is shown:\n> > > >\n> > > > ----------8<-----------------------------------------------------\n> > > > WARNING: git-filter-branch has a glut of gotchas generating mangled\n> > > > history\n> > > >         rewrites.  Hit Ctrl-C before proceeding to abort, then use an\n> > > >         alternative filtering tool such as 'git filter-repo'\n> > > >         (https://github.com/newren/git-filter-repo/) instead.  See the\n> > > >         filter-branch manual page for more details; to squelch this\n> > > >         warning,\n> > > >         set FILTER_BRANCH_SQUELCH_WARNING=1.\n> > > > ----------8<-----------------------------------------------------\n> > > >\n> > > > You can suppress this by setting the environment variable shown.\n> > > >\n> > > > What's different between what you expected and what actually happened?\n> > > >\n> > > > Normally, when git introduces this kind of change, there is a\n> > > > git config variable that one can set to suppress it.\n> > > > That way one has fine grade control when to suppress it (one repo\n> > > > only...globally).\n> > >\n> > > I think this comes from 9df53c5d (Recommend git-filter-repo instead\n> > > of git-filter-branch, 2019-09-04).\n> > >\n> > > FWIW, I personally do not think an environment is a worse choice\n> > > over configuration variable in this particular case.  The large\n> > > scale rewriting of the entire history in the repository by its\n> > > nature is an one-off operation that ought to happen only rarely,\n> > > so a one-shot\n> > >\n> > >         $ FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch ...\n> > >\n> > > that reminds the user every time would be more appropriate than a\n> > > configuration variable that has a more permanent squelching effect.\n> > >\n> > > If it were a new command line option may have been even better, as\n> > > an environment variable can be defined in .*rc and forgotten, but a\n> > > command line option needs to be typed every time and would serve as\n> > > a better reminder (yes, I know it can also be aliased away, so it\n> > > may not make much practical difference either way).\n> > >\n> > > But I'll let the author of the feature to comment.\n> > >\n> > > Thanks.\n> >\n> >I agree with Junio that filter-branch's one-off nature means that not\n> >providing a configuration variable seems reasonable in this case.  If\n> >someone else were to go to the effort of implementing some\n> >configuration option here, I wouldn't be that strongly against it,\n> >though I'd rather just let filter-branch lie dormant and stable.\n> >\n> >A new command line option might have been better, but it didn't occur\n> >to me at the time this change was made and I hesitate to needlessly\n> >force people to adapt again.\n>\n> I implemented the change and sent a pull request on github (#912) but failed\n> at GitGitGadget. Anyways, here’s the patch:\n>\n> ---\n> git-filter-branch.sh | 14 ++++++++++----\n> 1 file changed, 10 insertions(+), 4 deletions(-)\n>\n> diff --git a/git-filter-branch.sh b/git-filter-branch.sh\n> index fea7964617..fb55afcc86 100755\n> --- a/git-filter-branch.sh\n> +++ b/git-filter-branch.sh\n> @@ -83,15 +83,21 @@ set_ident () {\n>        finish_ident COMMITTER\n> }\n>\n> -if test -z\n> \"$FILTER_BRANCH_SQUELCH_WARNING$GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS\"\n> +if test -z\n> \"$FILTER_BRANCH_SQUELCH_WARNING$GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS\" && \\\n> +   test \"$(git config --bool filter-branch.squelchWarning)\" != true\n> then\n>        cat <<EOF\n> WARNING: git-filter-branch has a glut of gotchas generating mangled history\n> -        rewrites.  Hit Ctrl-C before proceeding to abort, then use an\n> +        rewrites. Hit Ctrl-C before proceeding to abort, then use an\n>         alternative filtering tool such as 'git filter-repo'\n> -        (https://github.com/newren/git-filter-repo/) instead.  See the\n> +        (https://github.com/newren/git-filter-repo/) instead. See the\n>         filter-branch manual page for more details; to squelch this warning,\n> -        set FILTER_BRANCH_SQUELCH_WARNING=1.\n> +         set FILTER_BRANCH_SQUELCH_WARNING=1 or run the following command:\n> +\n> +           git config filter-branch.squelchWarning true\n> +\n> +         You can replace \"git config\" with \"git config --global\" to disable\n> +         the warning for all repositories.\n> EOF\n>        sleep 10\n>        printf \"Proceeding with filter-branch...\\n\\n\"\n> --\n> 2.29.0\n\nThe first obstacle was that somebody had to `/allow` you (you probably\nmissed it; https://github.com/git/git/pull/912/#issuecomment-724637575 is\na bit of a verbose welcome message, but it _does_ mention it in the\n\"Contributing the patches\" section).\n\nThe GitGitGadget Pull Request still has the following issues:\n\n- the commit is not signed off\n- the commit message is not in a good shape (it consists of a single,\n  too-long line)\n\nI also left a couple more comments about the patch itself here:\nhttps://github.com/git/git/pull/912/#pullrequestreview-527112997\n\nCiao,\nJohannes\n"}]}