Git fork

Merge branch 'bf/explicit-config-set-in-advice-messages'

The advice messages now tell the newer 'git config set' command to
set the advice.token configuration variable to squelch a message.

* bf/explicit-config-set-in-advice-messages:
advice: suggest using subcommand "git config set"

+27 -27
+1 -1
advice.c
··· 93 93 94 94 static const char turn_off_instructions[] = 95 95 N_("\n" 96 - "Disable this message with \"git config advice.%s false\""); 96 + "Disable this message with \"git config set advice.%s false\""); 97 97 98 98 static void vadvise(const char *advice, int display_instructions, 99 99 const char *key, va_list params)
+1 -1
commit.c
··· 276 276 "to convert the grafts into replace refs.\n" 277 277 "\n" 278 278 "Turn this message off by running\n" 279 - "\"git config advice.graftFileDeprecated false\"")); 279 + "\"git config set advice.graftFileDeprecated false\"")); 280 280 while (!strbuf_getwholeline(&buf, fp, '\n')) { 281 281 /* The format is just "Commit Parent1 Parent2 ...\n" */ 282 282 struct commit_graft *graft = read_graft_line(&buf);
+1 -1
hook.c
··· 39 39 advise(_("The '%s' hook was ignored because " 40 40 "it's not set as executable.\n" 41 41 "You can disable this warning with " 42 - "`git config advice.ignoredHook false`."), 42 + "`git config set advice.ignoredHook false`."), 43 43 path.buf); 44 44 } 45 45 }
+1 -1
object-name.c
··· 952 952 "\n" 953 953 "where \"$br\" is somehow empty and a 40-hex ref is created. Please\n" 954 954 "examine these refs and maybe delete them. Turn this message off by\n" 955 - "running \"git config advice.objectNameWarning false\""); 955 + "running \"git config set advice.objectNameWarning false\""); 956 956 struct object_id tmp_oid; 957 957 char *real_ref = NULL; 958 958 int refs_found = 0;
+1 -1
t/t0018-advice.sh
··· 10 10 test_expect_success 'advice should be printed when config variable is unset' ' 11 11 cat >expect <<-\EOF && 12 12 hint: This is a piece of advice 13 - hint: Disable this message with "git config advice.nestedTag false" 13 + hint: Disable this message with "git config set advice.nestedTag false" 14 14 EOF 15 15 test-tool advise "This is a piece of advice" 2>actual && 16 16 test_cmp expect actual
+1 -1
t/t3200-branch.sh
··· 1696 1696 cat <<-\EOF >expect && 1697 1697 fatal: '\''foo..bar'\'' is not a valid branch name 1698 1698 hint: See `man git check-ref-format` 1699 - hint: Disable this message with "git config advice.refSyntax false" 1699 + hint: Disable this message with "git config set advice.refSyntax false" 1700 1700 EOF 1701 1701 test_must_fail git branch foo..bar >actual 2>&1 && 1702 1702 test_cmp expect actual
+3 -3
t/t3404-rebase-interactive.sh
··· 2258 2258 error: ${SQ}pick${SQ} does not accept merge commits 2259 2259 hint: ${SQ}pick${SQ} does not take a merge commit. If you wanted to 2260 2260 hint: replay the merge, use ${SQ}merge -C${SQ} on the commit. 2261 - hint: Disable this message with "git config advice.rebaseTodoError false" 2261 + hint: Disable this message with "git config set advice.rebaseTodoError false" 2262 2262 error: invalid line 1: pick $oid 2263 2263 error: ${SQ}reword${SQ} does not accept merge commits 2264 2264 hint: ${SQ}reword${SQ} does not take a merge commit. If you wanted to 2265 2265 hint: replay the merge and reword the commit message, use 2266 2266 hint: ${SQ}merge -c${SQ} on the commit 2267 - hint: Disable this message with "git config advice.rebaseTodoError false" 2267 + hint: Disable this message with "git config set advice.rebaseTodoError false" 2268 2268 error: invalid line 2: reword $oid 2269 2269 error: ${SQ}edit${SQ} does not accept merge commits 2270 2270 hint: ${SQ}edit${SQ} does not take a merge commit. If you wanted to 2271 2271 hint: replay the merge, use ${SQ}merge -C${SQ} on the commit, and then 2272 2272 hint: ${SQ}break${SQ} to give the control back to you so that you can 2273 2273 hint: do ${SQ}git commit --amend && git rebase --continue${SQ}. 2274 - hint: Disable this message with "git config advice.rebaseTodoError false" 2274 + hint: Disable this message with "git config set advice.rebaseTodoError false" 2275 2275 error: invalid line 3: edit $oid 2276 2276 error: cannot squash merge commit into another commit 2277 2277 error: invalid line 4: fixup $oid
+1 -1
t/t3501-revert-cherry-pick.sh
··· 177 177 hint: You can instead skip this commit with "git revert --skip". 178 178 hint: To abort and get back to the state before "git revert", 179 179 hint: run "git revert --abort". 180 - hint: Disable this message with "git config advice.mergeConflict false" 180 + hint: Disable this message with "git config set advice.mergeConflict false" 181 181 EOF 182 182 test_commit --append --no-tag "double-add dream" dream dream && 183 183 test_must_fail git revert HEAD^ 2>actual &&
+3 -3
t/t3507-cherry-pick-conflict.sh
··· 34 34 git commit --allow-empty --allow-empty-message && 35 35 git tag empty && 36 36 git checkout main && 37 - git config advice.detachedhead false 37 + git config set advice.detachedhead false 38 38 39 39 ' 40 40 ··· 60 60 hint: You can instead skip this commit with "git cherry-pick --skip". 61 61 hint: To abort and get back to the state before "git cherry-pick", 62 62 hint: run "git cherry-pick --abort". 63 - hint: Disable this message with "git config advice.mergeConflict false" 63 + hint: Disable this message with "git config set advice.mergeConflict false" 64 64 EOF 65 65 test_must_fail git cherry-pick picked 2>actual && 66 66 ··· 75 75 error: could not apply \$picked... picked 76 76 hint: after resolving the conflicts, mark the corrected paths 77 77 hint: with 'git add <paths>' or 'git rm <paths>' 78 - hint: Disable this message with \"git config advice.mergeConflict false\" 78 + hint: Disable this message with \"git config set advice.mergeConflict false\" 79 79 EOF 80 80 test_must_fail git cherry-pick --no-commit picked 2>actual && 81 81
+1 -1
t/t3510-cherry-pick-sequence.sh
··· 25 25 } 26 26 27 27 test_expect_success setup ' 28 - git config advice.detachedhead false && 28 + git config set advice.detachedhead false && 29 29 echo unrelated >unrelated && 30 30 git add unrelated && 31 31 test_commit initial foo a &&
+1 -1
t/t3511-cherry-pick-x.sh
··· 51 51 " 52 52 53 53 test_expect_success setup ' 54 - git config advice.detachedhead false && 54 + git config set advice.detachedhead false && 55 55 echo unrelated >unrelated && 56 56 git add unrelated && 57 57 test_commit initial foo a &&
+1 -1
t/t3602-rm-sparse-checkout.sh
··· 20 20 hint: If you intend to update such entries, try one of the following: 21 21 hint: * Use the --sparse option. 22 22 hint: * Disable or modify the sparsity rules. 23 - hint: Disable this message with \"git config advice.updateSparsePath false\" 23 + hint: Disable this message with \"git config set advice.updateSparsePath false\" 24 24 EOF 25 25 26 26 echo b | cat sparse_error_header - >sparse_entry_b_error &&
+3 -3
t/t3700-add.sh
··· 31 31 cat >expect <<-EOF && 32 32 Nothing specified, nothing added. 33 33 hint: Maybe you wanted to say ${SQ}git add .${SQ}? 34 - hint: Disable this message with "git config advice.addEmptyPathspec false" 34 + hint: Disable this message with "git config set advice.addEmptyPathspec false" 35 35 EOF 36 36 git add 2>actual && 37 37 test_cmp expect actual ··· 375 375 hint: git rm --cached inner1 376 376 hint: 377 377 hint: See "git help submodule" for more information. 378 - hint: Disable this message with "git config advice.addEmbeddedRepo false" 378 + hint: Disable this message with "git config set advice.addEmbeddedRepo false" 379 379 warning: adding embedded git repository: inner2 380 380 EOF 381 381 test_cmp expect actual ··· 413 413 The following paths are ignored by one of your .gitignore files: 414 414 ignored-file 415 415 hint: Use -f if you really want to add them. 416 - hint: Disable this message with "git config advice.addIgnoredFile false" 416 + hint: Disable this message with "git config set advice.addIgnoredFile false" 417 417 EOF 418 418 cat >expect.out <<\EOF 419 419 add 'track-this'
+1 -1
t/t3705-add-sparse-checkout.sh
··· 54 54 hint: If you intend to update such entries, try one of the following: 55 55 hint: * Use the --sparse option. 56 56 hint: * Disable or modify the sparsity rules. 57 - hint: Disable this message with \"git config advice.updateSparsePath false\" 57 + hint: Disable this message with \"git config set advice.updateSparsePath false\" 58 58 EOF 59 59 60 60 echo sparse_entry | cat sparse_error_header - >sparse_entry_error &&
+2 -2
t/t7002-mv-sparse-checkout.sh
··· 32 32 hint: If you intend to update such entries, try one of the following: 33 33 hint: * Use the --sparse option. 34 34 hint: * Disable or modify the sparsity rules. 35 - hint: Disable this message with \"git config advice.updateSparsePath false\" 35 + hint: Disable this message with \"git config set advice.updateSparsePath false\" 36 36 EOF 37 37 38 38 cat >dirty_error_header <<-EOF && ··· 45 45 hint: To correct the sparsity of these paths, do the following: 46 46 hint: * Use \"git add --sparse <paths>\" to update the index 47 47 hint: * Use \"git sparse-checkout reapply\" to apply the sparsity rules 48 - hint: Disable this message with \"git config advice.updateSparsePath false\" 48 + hint: Disable this message with \"git config set advice.updateSparsePath false\" 49 49 EOF 50 50 " 51 51
+1 -1
t/t7004-tag.sh
··· 1862 1862 hint: already a tag. If you meant to tag the object that it points to, use: 1863 1863 hint: 1864 1864 hint: git tag -f nested annotated-v4.0^{} 1865 - hint: Disable this message with "git config advice.nestedTag false" 1865 + hint: Disable this message with "git config set advice.nestedTag false" 1866 1866 EOF 1867 1867 git tag -m nested nested annotated-v4.0 2>actual && 1868 1868 test_cmp expect actual
+2 -2
t/t7201-co.sh
··· 224 224 ' 225 225 226 226 test_expect_success 'checkout to detach HEAD (with advice declined)' ' 227 - git config advice.detachedHead false && 227 + git config set advice.detachedHead false && 228 228 rev=$(git rev-parse --short renamer^) && 229 229 git checkout -f renamer && 230 230 git clean -f && ··· 244 244 ' 245 245 246 246 test_expect_success 'checkout to detach HEAD' ' 247 - git config advice.detachedHead true && 247 + git config set advice.detachedHead true && 248 248 rev=$(git rev-parse --short renamer^) && 249 249 git checkout -f renamer && 250 250 git clean -f &&
+1 -1
t/t7400-submodule-basic.sh
··· 212 212 The following paths are ignored by one of your .gitignore files: 213 213 submod 214 214 hint: Use -f if you really want to add them. 215 - hint: Disable this message with "git config advice.addIgnoredFile false" 215 + hint: Disable this message with "git config set advice.addIgnoredFile false" 216 216 EOF 217 217 # Does not use test_commit due to the ignore 218 218 echo "*" > .gitignore &&
+1 -1
t/t7508-status.sh
··· 1699 1699 EOF 1700 1700 git add .gitignore && 1701 1701 git commit -m "Add .gitignore" && 1702 - git config advice.statusuoption true 1702 + git config set advice.statusuoption true 1703 1703 ) 1704 1704 ' 1705 1705