From: Junio C Hamano Date: Fri, 29 Mar 2024 17:40:05 GMT Subject: Re: [PATCH 1/3] add: use advise_if_enabled for ADVICE_ADD_IGNORED_FILE Message-ID: In-Reply-To: <37f79186-b849-496a-ae91-f5e05a280dae@gmail.com> Rubén Justo writes: > - if (advice_enabled(ADVICE_ADD_IGNORED_FILE)) > - advise(_("Use -f if you really want to add them.\n" > - "Turn this message off by running\n" > - "\"git config advice.addIgnoredFile false\"")); > + advise_if_enabled(ADVICE_ADD_IGNORED_FILE, > + _("Use -f if you really want to add them.")); Good. > exit_status = 1; > } > > diff --git a/t/t3700-add.sh b/t/t3700-add.sh > index f23d39f0d5..76c2c9e7b0 100755 > --- a/t/t3700-add.sh > +++ b/t/t3700-add.sh > @@ -370,8 +370,7 @@ cat >expect.err <<\EOF > The following paths are ignored by one of your .gitignore files: > ignored-file > hint: Use -f if you really want to add them. > -hint: Turn this message off by running > -hint: "git config advice.addIgnoredFile false" > +hint: Disable this message with "git config advice.addIgnoredFile false" Funny that we weremanually crafting the hint to turn it off. Nice to see that code go. > EOF > cat >expect.out <<\EOF > add 'track-this' > diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh > index 00c1f1aab1..5c4a89df5c 100755 > --- a/t/t7400-submodule-basic.sh > +++ b/t/t7400-submodule-basic.sh > @@ -212,8 +212,7 @@ test_expect_success 'submodule add to .gitignored path fails' ' > The following paths are ignored by one of your .gitignore files: > submod > hint: Use -f if you really want to add them. > - hint: Turn this message off by running > - hint: "git config advice.addIgnoredFile false" > + hint: Disable this message with "git config advice.addIgnoredFile false" > EOF > # Does not use test_commit due to the ignore > echo "*" > .gitignore &&