Skip to content

Commit 290c940

Browse files
committed
Merge branch 'js/pull-rebase-use-advise'
UI improvement. * js/pull-rebase-use-advise: pull: colorize the hint about setting `pull.rebase`
2 parents 376b4cc + e01ae2a commit 290c940

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

builtin/pull.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -345,18 +345,18 @@ static enum rebase_type config_get_rebase(void)
345345
return parse_config_rebase("pull.rebase", value, 1);
346346

347347
if (opt_verbosity >= 0 && !opt_ff) {
348-
warning(_("Pulling without specifying how to reconcile divergent branches is\n"
349-
"discouraged. You can squelch this message by running one of the following\n"
350-
"commands sometime before your next pull:\n"
351-
"\n"
352-
" git config pull.rebase false # merge (the default strategy)\n"
353-
" git config pull.rebase true # rebase\n"
354-
" git config pull.ff only # fast-forward only\n"
355-
"\n"
356-
"You can replace \"git config\" with \"git config --global\" to set a default\n"
357-
"preference for all repositories. You can also pass --rebase, --no-rebase,\n"
358-
"or --ff-only on the command line to override the configured default per\n"
359-
"invocation.\n"));
348+
advise(_("Pulling without specifying how to reconcile divergent branches is\n"
349+
"discouraged. You can squelch this message by running one of the following\n"
350+
"commands sometime before your next pull:\n"
351+
"\n"
352+
" git config pull.rebase false # merge (the default strategy)\n"
353+
" git config pull.rebase true # rebase\n"
354+
" git config pull.ff only # fast-forward only\n"
355+
"\n"
356+
"You can replace \"git config\" with \"git config --global\" to set a default\n"
357+
"preference for all repositories. You can also pass --rebase, --no-rebase,\n"
358+
"or --ff-only on the command line to override the configured default per\n"
359+
"invocation.\n"));
360360
}
361361

362362
return REBASE_FALSE;

t/t7601-merge-pull-config.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ test_expect_success 'setup' '
2929

3030
test_expect_success 'pull.rebase not set' '
3131
git reset --hard c0 &&
32-
git pull . c1 2>err &&
33-
test_i18ngrep "Pulling without specifying how to reconcile" err
32+
git -c color.advice=always pull . c1 2>err &&
33+
test_decode_color <err >decoded &&
34+
test_i18ngrep "<YELLOW>hint: " decoded &&
35+
test_i18ngrep "Pulling without specifying how to reconcile" decoded
36+
3437
'
3538

3639
test_expect_success 'pull.rebase not set and pull.ff=true' '

0 commit comments

Comments
 (0)