{"thread":{"id":"54290","subject":"[PATCH] pull: don't warn if pull.ff has been set","startedAt":"2020-09-25T03:50:43Z","lastAt":"2020-09-26T05:41:43Z","messageCount":2,"participants":["Alex Henrie","Denton Liu"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"406294","messageId":"20200925035023.8771-1-alexhenrie24@gmail.com","threadId":"54290","inReplyTo":null,"subject":"[PATCH] pull: don't warn if pull.ff has been set","fromName":"Alex Henrie","fromEmail":"alexhenrie24@gmail.com","sentAt":"2020-09-25T03:50:23Z","receivedAt":"2020-09-25T03:50:43Z","isPatch":true,"sender":{"key":"alexhenrie24@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5951993?v=4"},"body":"A user who understands enough to set pull.ff does not need additional\ninstructions.\n\nSigned-off-by: Alex Henrie <alexhenrie24@gmail.com>\n---\n builtin/pull.c               |  3 +--\n t/t7601-merge-pull-config.sh | 21 ++++++++++++++++++++-\n 2 files changed, 21 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/pull.c b/builtin/pull.c\nindex 015f6ded0b..425950f469 100644\n--- a/builtin/pull.c\n+++ b/builtin/pull.c\n@@ -344,8 +344,7 @@ static enum rebase_type config_get_rebase(void)\n \tif (!git_config_get_value(\"pull.rebase\", &value))\n \t\treturn parse_config_rebase(\"pull.rebase\", value, 1);\n \n-\tif (opt_verbosity >= 0 &&\n-\t    (!opt_ff || strcmp(opt_ff, \"--ff-only\"))) {\n+\tif (opt_verbosity >= 0 && !opt_ff) {\n \t\twarning(_(\"Pulling without specifying how to reconcile divergent branches is\\n\"\n \t\t\t\"discouraged. You can squelch this message by running one of the following\\n\"\n \t\t\t\"commands sometime before your next pull:\\n\"\ndiff --git a/t/t7601-merge-pull-config.sh b/t/t7601-merge-pull-config.sh\nindex 0f97828cd0..c5c4ea5fc0 100755\n--- a/t/t7601-merge-pull-config.sh\n+++ b/t/t7601-merge-pull-config.sh\n@@ -33,11 +33,18 @@ test_expect_success 'pull.rebase not set' '\n \ttest_i18ngrep \"Pulling without specifying how to reconcile\" err\n '\n \n+test_expect_success 'pull.rebase not set and pull.ff=true' '\n+\tgit reset --hard c0 &&\n+\ttest_config pull.ff true &&\n+\tgit pull . c1 2>err &&\n+\ttest_i18ngrep ! \"Pulling without specifying how to reconcile\" err\n+'\n+\n test_expect_success 'pull.rebase not set and pull.ff=false' '\n \tgit reset --hard c0 &&\n \ttest_config pull.ff false &&\n \tgit pull . c1 2>err &&\n-\ttest_i18ngrep \"Pulling without specifying how to reconcile\" err\n+\ttest_i18ngrep ! \"Pulling without specifying how to reconcile\" err\n '\n \n test_expect_success 'pull.rebase not set and pull.ff=only' '\n@@ -59,6 +66,18 @@ test_expect_success 'pull.rebase not set and --no-rebase given' '\n \ttest_i18ngrep ! \"Pulling without specifying how to reconcile\" err\n '\n \n+test_expect_success 'pull.rebase not set and --ff given' '\n+\tgit reset --hard c0 &&\n+\tgit pull --ff . c1 2>err &&\n+\ttest_i18ngrep ! \"Pulling without specifying how to reconcile\" err\n+'\n+\n+test_expect_success 'pull.rebase not set and --no-ff given' '\n+\tgit reset --hard c0 &&\n+\tgit pull --no-ff . c1 2>err &&\n+\ttest_i18ngrep ! \"Pulling without specifying how to reconcile\" err\n+'\n+\n test_expect_success 'pull.rebase not set and --ff-only given' '\n \tgit reset --hard c0 &&\n \tgit pull --ff-only . c1 2>err &&\n-- \n2.28.0\n\n"},{"id":"406413","messageId":"20200926054139.GA230339@generichostname","threadId":"54290","inReplyTo":"20200925035023.8771-1-alexhenrie24@gmail.com","subject":"Re: [PATCH] pull: don't warn if pull.ff has been set","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2020-09-26T05:41:39Z","receivedAt":"2020-09-26T05:41:43Z","isPatch":true,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"Hi Alex, thanks for doing this.\n\nOn Thu, Sep 24, 2020 at 09:50:23PM -0600, Alex Henrie wrote:\n> A user who understands enough to set pull.ff does not need additional\n> instructions.\n> \n> Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>\n\nReviewed-by: Denton Liu <liu.denton@gmail.com>\n"}]}