git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] test: pull: add test for disabling pull.ff=only
@ 2021-07-11 17:07 Felipe Contreras
  2021-07-12  4:42 ` Bagas Sanjaya
  0 siblings, 1 reply; 3+ messages in thread
From: Felipe Contreras @ 2021-07-11 17:07 UTC (permalink / raw)
  To: git; +Cc: Alex Henrie, Junio C Hamano, Felipe Contreras

The advice clearly says it should be possible to override pull.ff=only
with --rebase:

  You can also pass --rebase, --no-rebase, or --ff-only on the command
  line to override the configured default per invocation.

Since the intended behavior of `git pull` is very easily forgotten let's
add a test to make sure it isn't.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 t/t7601-merge-pull-config.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/t/t7601-merge-pull-config.sh b/t/t7601-merge-pull-config.sh
index 52e8ccc933..72164593fd 100755
--- a/t/t7601-merge-pull-config.sh
+++ b/t/t7601-merge-pull-config.sh
@@ -183,6 +183,12 @@ test_expect_success 'pull prevents non-fast-forward with "only" in pull.ff' '
 	test_must_fail git pull . c3
 '
 
+test_expect_success 'pull allows non-fast-forward with "only" in pull.ff if --rebase' '
+	git reset --hard c1 &&
+	test_config pull.ff only &&
+	git pull --rebase . c3
+'
+
 test_expect_success 'merge c1 with c2 (ours in pull.twohead)' '
 	git reset --hard c1 &&
 	git config pull.twohead ours &&
-- 
2.32.0.172.gaf9b24eeb1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] test: pull: add test for disabling pull.ff=only
  2021-07-11 17:07 [PATCH] test: pull: add test for disabling pull.ff=only Felipe Contreras
@ 2021-07-12  4:42 ` Bagas Sanjaya
  2021-07-12  5:34   ` Felipe Contreras
  0 siblings, 1 reply; 3+ messages in thread
From: Bagas Sanjaya @ 2021-07-12  4:42 UTC (permalink / raw)
  To: Felipe Contreras, git; +Cc: Alex Henrie, Junio C Hamano

On 12/07/21 00.07, Felipe Contreras wrote:
> The advice clearly says it should be possible to override pull.ff=only
> with --rebase:
> 
>    You can also pass --rebase, --no-rebase, or --ff-only on the command
>    line to override the configured default per invocation.
> 
> Since the intended behavior of `git pull` is very easily forgotten let's
> add a test to make sure it isn't.
> 

Is pull.ff=only only do fast-forward merge when pulling?

> +test_expect_success 'pull allows non-fast-forward with "only" in pull.ff if --rebase' '
> +	git reset --hard c1 &&
> +	test_config pull.ff only &&
> +	git pull --rebase . c3
> +'
> +

Better say 'pull allows non-fast-forward (using --rebase) regardless of 
pull.ff=only config'

-- 
An old man doll... just what I always wanted! - Clara

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] test: pull: add test for disabling pull.ff=only
  2021-07-12  4:42 ` Bagas Sanjaya
@ 2021-07-12  5:34   ` Felipe Contreras
  0 siblings, 0 replies; 3+ messages in thread
From: Felipe Contreras @ 2021-07-12  5:34 UTC (permalink / raw)
  To: Bagas Sanjaya, Felipe Contreras, git; +Cc: Alex Henrie, Junio C Hamano

Bagas Sanjaya wrote:
> On 12/07/21 00.07, Felipe Contreras wrote:
> > The advice clearly says it should be possible to override pull.ff=only
> > with --rebase:
> > 
> >    You can also pass --rebase, --no-rebase, or --ff-only on the command
> >    line to override the configured default per invocation.
> > 
> > Since the intended behavior of `git pull` is very easily forgotten let's
> > add a test to make sure it isn't.
> > 
> 
> Is pull.ff=only only do fast-forward merge when pulling?

Only when the pull is a merge pull (although there are proposals to
change that).

> > +test_expect_success 'pull allows non-fast-forward with "only" in pull.ff if --rebase' '
> > +	git reset --hard c1 &&
> > +	test_config pull.ff only &&
> > +	git pull --rebase . c3
> > +'
> > +
> 
> Better say 'pull allows non-fast-forward (using --rebase) regardless of 
> pull.ff=only config'

In English parentheses are used for stuff that isn't essential (i.e.
optional).

If you remove what is inside the parenthesis the title loses the most
important part, so I don't think that's an improvement.

Cheers.

-- 
Felipe Contreras

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-12  5:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-11 17:07 [PATCH] test: pull: add test for disabling pull.ff=only Felipe Contreras
2021-07-12  4:42 ` Bagas Sanjaya
2021-07-12  5:34   ` Felipe Contreras

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).