{"thread":{"id":"56094","subject":"[PATCH] test: pull: add test for disabling pull.ff=only","startedAt":"2021-07-11T17:07:10Z","lastAt":"2021-07-12T05:35:01Z","messageCount":3,"participants":["Felipe Contreras","Bagas Sanjaya"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"429709","messageId":"20210711170703.651081-1-felipe.contreras@gmail.com","threadId":"56094","inReplyTo":null,"subject":"[PATCH] test: pull: add test for disabling pull.ff=only","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-07-11T17:07:03Z","receivedAt":"2021-07-11T17:07:10Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"The advice clearly says it should be possible to override pull.ff=only\nwith --rebase:\n\n  You can also pass --rebase, --no-rebase, or --ff-only on the command\n  line to override the configured default per invocation.\n\nSince the intended behavior of `git pull` is very easily forgotten let's\nadd a test to make sure it isn't.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n t/t7601-merge-pull-config.sh | 6 ++++++\n 1 file changed, 6 insertions(+)\n\ndiff --git a/t/t7601-merge-pull-config.sh b/t/t7601-merge-pull-config.sh\nindex 52e8ccc933..72164593fd 100755\n--- a/t/t7601-merge-pull-config.sh\n+++ b/t/t7601-merge-pull-config.sh\n@@ -183,6 +183,12 @@ test_expect_success 'pull prevents non-fast-forward with \"only\" in pull.ff' '\n \ttest_must_fail git pull . c3\n '\n \n+test_expect_success 'pull allows non-fast-forward with \"only\" in pull.ff if --rebase' '\n+\tgit reset --hard c1 &&\n+\ttest_config pull.ff only &&\n+\tgit pull --rebase . c3\n+'\n+\n test_expect_success 'merge c1 with c2 (ours in pull.twohead)' '\n \tgit reset --hard c1 &&\n \tgit config pull.twohead ours &&\n-- \n2.32.0.172.gaf9b24eeb1\n\n"},{"id":"429716","messageId":"ef5ca2bf-3a7a-aa9e-40a2-6b1fe04e323e@gmail.com","threadId":"56094","inReplyTo":"20210711170703.651081-1-felipe.contreras@gmail.com","subject":"Re: [PATCH] test: pull: add test for disabling pull.ff=only","fromName":"Bagas Sanjaya","fromEmail":"bagasdotme@gmail.com","sentAt":"2021-07-12T04:42:34Z","receivedAt":"2021-07-12T04:42:41Z","isPatch":true,"sender":{"key":"bagasdotme@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40219486?v=4"},"body":"On 12/07/21 00.07, Felipe Contreras wrote:\n> The advice clearly says it should be possible to override pull.ff=only\n> with --rebase:\n> \n>    You can also pass --rebase, --no-rebase, or --ff-only on the command\n>    line to override the configured default per invocation.\n> \n> Since the intended behavior of `git pull` is very easily forgotten let's\n> add a test to make sure it isn't.\n> \n\nIs pull.ff=only only do fast-forward merge when pulling?\n\n> +test_expect_success 'pull allows non-fast-forward with \"only\" in pull.ff if --rebase' '\n> +\tgit reset --hard c1 &&\n> +\ttest_config pull.ff only &&\n> +\tgit pull --rebase . c3\n> +'\n> +\n\nBetter say 'pull allows non-fast-forward (using --rebase) regardless of \npull.ff=only config'\n\n-- \nAn old man doll... just what I always wanted! - Clara\n"},{"id":"429717","messageId":"60ebd47d9dc2f_a407e208f1@natae.notmuch","threadId":"56094","inReplyTo":"ef5ca2bf-3a7a-aa9e-40a2-6b1fe04e323e@gmail.com","subject":"Re: [PATCH] test: pull: add test for disabling pull.ff=only","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-07-12T05:34:53Z","receivedAt":"2021-07-12T05:35:01Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Bagas Sanjaya wrote:\n> On 12/07/21 00.07, Felipe Contreras wrote:\n> > The advice clearly says it should be possible to override pull.ff=only\n> > with --rebase:\n> > \n> >    You can also pass --rebase, --no-rebase, or --ff-only on the command\n> >    line to override the configured default per invocation.\n> > \n> > Since the intended behavior of `git pull` is very easily forgotten let's\n> > add a test to make sure it isn't.\n> > \n> \n> Is pull.ff=only only do fast-forward merge when pulling?\n\nOnly when the pull is a merge pull (although there are proposals to\nchange that).\n\n> > +test_expect_success 'pull allows non-fast-forward with \"only\" in pull.ff if --rebase' '\n> > +\tgit reset --hard c1 &&\n> > +\ttest_config pull.ff only &&\n> > +\tgit pull --rebase . c3\n> > +'\n> > +\n> \n> Better say 'pull allows non-fast-forward (using --rebase) regardless of \n> pull.ff=only config'\n\nIn English parentheses are used for stuff that isn't essential (i.e.\noptional).\n\nIf you remove what is inside the parenthesis the title loses the most\nimportant part, so I don't think that's an improvement.\n\nCheers.\n\n-- \nFelipe Contreras\n"}]}