Skip to content

Commit e6663b9

Browse files
committed
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"
2 parents ab738b2 + 6c397d0 commit e6663b9

19 files changed

+27
-27
lines changed

advice.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ static struct {
9393

9494
static const char turn_off_instructions[] =
9595
N_("\n"
96-
"Disable this message with \"git config advice.%s false\"");
96+
"Disable this message with \"git config set advice.%s false\"");
9797

9898
static void vadvise(const char *advice, int display_instructions,
9999
const char *key, va_list params)

commit.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ static int read_graft_file(struct repository *r, const char *graft_file)
276276
"to convert the grafts into replace refs.\n"
277277
"\n"
278278
"Turn this message off by running\n"
279-
"\"git config advice.graftFileDeprecated false\""));
279+
"\"git config set advice.graftFileDeprecated false\""));
280280
while (!strbuf_getwholeline(&buf, fp, '\n')) {
281281
/* The format is just "Commit Parent1 Parent2 ...\n" */
282282
struct commit_graft *graft = read_graft_line(&buf);

hook.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const char *find_hook(struct repository *r, const char *name)
3939
advise(_("The '%s' hook was ignored because "
4040
"it's not set as executable.\n"
4141
"You can disable this warning with "
42-
"`git config advice.ignoredHook false`."),
42+
"`git config set advice.ignoredHook false`."),
4343
path.buf);
4444
}
4545
}

object-name.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ static int get_oid_basic(struct repository *r, const char *str, int len,
952952
"\n"
953953
"where \"$br\" is somehow empty and a 40-hex ref is created. Please\n"
954954
"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\"");
956956
struct object_id tmp_oid;
957957
char *real_ref = NULL;
958958
int refs_found = 0;

t/t0018-advice.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
1010
test_expect_success 'advice should be printed when config variable is unset' '
1111
cat >expect <<-\EOF &&
1212
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"
1414
EOF
1515
test-tool advise "This is a piece of advice" 2>actual &&
1616
test_cmp expect actual

t/t3200-branch.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1696,7 +1696,7 @@ test_expect_success 'errors if given a bad branch name' '
16961696
cat <<-\EOF >expect &&
16971697
fatal: '\''foo..bar'\'' is not a valid branch name
16981698
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"
17001700
EOF
17011701
test_must_fail git branch foo..bar >actual 2>&1 &&
17021702
test_cmp expect actual

t/t3404-rebase-interactive.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -2258,20 +2258,20 @@ test_expect_success 'non-merge commands reject merge commits' '
22582258
error: ${SQ}pick${SQ} does not accept merge commits
22592259
hint: ${SQ}pick${SQ} does not take a merge commit. If you wanted to
22602260
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"
22622262
error: invalid line 1: pick $oid
22632263
error: ${SQ}reword${SQ} does not accept merge commits
22642264
hint: ${SQ}reword${SQ} does not take a merge commit. If you wanted to
22652265
hint: replay the merge and reword the commit message, use
22662266
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"
22682268
error: invalid line 2: reword $oid
22692269
error: ${SQ}edit${SQ} does not accept merge commits
22702270
hint: ${SQ}edit${SQ} does not take a merge commit. If you wanted to
22712271
hint: replay the merge, use ${SQ}merge -C${SQ} on the commit, and then
22722272
hint: ${SQ}break${SQ} to give the control back to you so that you can
22732273
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"
22752275
error: invalid line 3: edit $oid
22762276
error: cannot squash merge commit into another commit
22772277
error: invalid line 4: fixup $oid

t/t3501-revert-cherry-pick.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ test_expect_success 'advice from failed revert' '
177177
hint: You can instead skip this commit with "git revert --skip".
178178
hint: To abort and get back to the state before "git revert",
179179
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"
181181
EOF
182182
test_commit --append --no-tag "double-add dream" dream dream &&
183183
test_must_fail git revert HEAD^ 2>actual &&

t/t3507-cherry-pick-conflict.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ test_expect_success setup '
3434
git commit --allow-empty --allow-empty-message &&
3535
git tag empty &&
3636
git checkout main &&
37-
git config advice.detachedhead false
37+
git config set advice.detachedhead false
3838
3939
'
4040

@@ -60,7 +60,7 @@ test_expect_success 'advice from failed cherry-pick' '
6060
hint: You can instead skip this commit with "git cherry-pick --skip".
6161
hint: To abort and get back to the state before "git cherry-pick",
6262
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"
6464
EOF
6565
test_must_fail git cherry-pick picked 2>actual &&
6666
@@ -75,7 +75,7 @@ test_expect_success 'advice from failed cherry-pick --no-commit' "
7575
error: could not apply \$picked... picked
7676
hint: after resolving the conflicts, mark the corrected paths
7777
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\"
7979
EOF
8080
test_must_fail git cherry-pick --no-commit picked 2>actual &&
8181

t/t3510-cherry-pick-sequence.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pristine_detach () {
2525
}
2626

2727
test_expect_success setup '
28-
git config advice.detachedhead false &&
28+
git config set advice.detachedhead false &&
2929
echo unrelated >unrelated &&
3030
git add unrelated &&
3131
test_commit initial foo a &&

t/t3511-cherry-pick-x.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ trailing empty lines
5151
"
5252

5353
test_expect_success setup '
54-
git config advice.detachedhead false &&
54+
git config set advice.detachedhead false &&
5555
echo unrelated >unrelated &&
5656
git add unrelated &&
5757
test_commit initial foo a &&

t/t3602-rm-sparse-checkout.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ test_expect_success 'setup' "
2020
hint: If you intend to update such entries, try one of the following:
2121
hint: * Use the --sparse option.
2222
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\"
2424
EOF
2525
2626
echo b | cat sparse_error_header - >sparse_entry_b_error &&

t/t3700-add.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ test_expect_success 'Test with no pathspecs' '
3131
cat >expect <<-EOF &&
3232
Nothing specified, nothing added.
3333
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"
3535
EOF
3636
git add 2>actual &&
3737
test_cmp expect actual
@@ -375,7 +375,7 @@ test_expect_success '"git add" a embedded repository' '
375375
hint: git rm --cached inner1
376376
hint:
377377
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"
379379
warning: adding embedded git repository: inner2
380380
EOF
381381
test_cmp expect actual
@@ -413,7 +413,7 @@ cat >expect.err <<\EOF
413413
The following paths are ignored by one of your .gitignore files:
414414
ignored-file
415415
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"
417417
EOF
418418
cat >expect.out <<\EOF
419419
add 'track-this'

t/t3705-add-sparse-checkout.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ test_expect_success 'setup' "
5454
hint: If you intend to update such entries, try one of the following:
5555
hint: * Use the --sparse option.
5656
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\"
5858
EOF
5959
6060
echo sparse_entry | cat sparse_error_header - >sparse_entry_error &&

t/t7002-mv-sparse-checkout.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ test_expect_success 'setup' "
3232
hint: If you intend to update such entries, try one of the following:
3333
hint: * Use the --sparse option.
3434
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\"
3636
EOF
3737
3838
cat >dirty_error_header <<-EOF &&
@@ -45,7 +45,7 @@ test_expect_success 'setup' "
4545
hint: To correct the sparsity of these paths, do the following:
4646
hint: * Use \"git add --sparse <paths>\" to update the index
4747
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\"
4949
EOF
5050
"
5151

t/t7004-tag.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1862,7 +1862,7 @@ test_expect_success 'recursive tagging should give advice' '
18621862
hint: already a tag. If you meant to tag the object that it points to, use:
18631863
hint:
18641864
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"
18661866
EOF
18671867
git tag -m nested nested annotated-v4.0 2>actual &&
18681868
test_cmp expect actual

t/t7201-co.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ test_expect_success 'switch to another branch while carrying a deletion' '
224224
'
225225

226226
test_expect_success 'checkout to detach HEAD (with advice declined)' '
227-
git config advice.detachedHead false &&
227+
git config set advice.detachedHead false &&
228228
rev=$(git rev-parse --short renamer^) &&
229229
git checkout -f renamer &&
230230
git clean -f &&
@@ -244,7 +244,7 @@ test_expect_success 'checkout to detach HEAD (with advice declined)' '
244244
'
245245

246246
test_expect_success 'checkout to detach HEAD' '
247-
git config advice.detachedHead true &&
247+
git config set advice.detachedHead true &&
248248
rev=$(git rev-parse --short renamer^) &&
249249
git checkout -f renamer &&
250250
git clean -f &&

t/t7400-submodule-basic.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ test_expect_success 'submodule add to .gitignored path fails' '
212212
The following paths are ignored by one of your .gitignore files:
213213
submod
214214
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"
216216
EOF
217217
# Does not use test_commit due to the ignore
218218
echo "*" > .gitignore &&

t/t7508-status.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1699,7 +1699,7 @@ test_expect_success 'setup slow status advice' '
16991699
EOF
17001700
git add .gitignore &&
17011701
git commit -m "Add .gitignore" &&
1702-
git config advice.statusuoption true
1702+
git config set advice.statusuoption true
17031703
)
17041704
'
17051705

0 commit comments

Comments
 (0)