|
27 | 27 | #include "commit-reach.h"
|
28 | 28 | #include "sequencer.h"
|
29 | 29 |
|
| 30 | +static int default_mode; |
| 31 | + |
30 | 32 | /**
|
31 | 33 | * Parses the value of --rebase. If value is a false value, returns
|
32 | 34 | * REBASE_FALSE. If value is a true value, returns REBASE_TRUE. If value is
|
@@ -344,20 +346,7 @@ static enum rebase_type config_get_rebase(void)
|
344 | 346 | if (!git_config_get_value("pull.rebase", &value))
|
345 | 347 | return parse_config_rebase("pull.rebase", value, 1);
|
346 | 348 |
|
347 |
| - if (opt_verbosity >= 0 && !opt_ff) { |
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")); |
360 |
| - } |
| 349 | + default_mode = 1; |
361 | 350 |
|
362 | 351 | return REBASE_FALSE;
|
363 | 352 | }
|
@@ -1040,6 +1029,21 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
|
1040 | 1029 | if (opt_rebase && merge_heads.nr > 1)
|
1041 | 1030 | die(_("Cannot rebase onto multiple branches."));
|
1042 | 1031 |
|
| 1032 | + if (default_mode && opt_verbosity >= 0 && !opt_ff) { |
| 1033 | + advise(_("Pulling without specifying how to reconcile divergent branches is\n" |
| 1034 | + "discouraged. You can squelch this message by running one of the following\n" |
| 1035 | + "commands sometime before your next pull:\n" |
| 1036 | + "\n" |
| 1037 | + " git config pull.rebase false # merge (the default strategy)\n" |
| 1038 | + " git config pull.rebase true # rebase\n" |
| 1039 | + " git config pull.ff only # fast-forward only\n" |
| 1040 | + "\n" |
| 1041 | + "You can replace \"git config\" with \"git config --global\" to set a default\n" |
| 1042 | + "preference for all repositories. You can also pass --rebase, --no-rebase,\n" |
| 1043 | + "or --ff-only on the command line to override the configured default per\n" |
| 1044 | + "invocation.\n")); |
| 1045 | + } |
| 1046 | + |
1043 | 1047 | if (opt_rebase) {
|
1044 | 1048 | int ret = 0;
|
1045 | 1049 | int ran_ff = 0;
|
|
0 commit comments