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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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 &&

0 commit comments

Comments
 (0)