threads / discuss / 33900

override merge.ff = false using --ff-only

Subject: override merge.ff = false using --ff-only

## tl;dr

3 messages between May 22, 2013 and May 22, 2013.

replies: 2people: 3as markdown or json

Matt McClure· May 22, 2013, 13:21 UTC · lore

I naively tried to override merge.ff = false using --ff-only on the command line. I expected that it would override the configured default and perform a fast-forward merge. Instead, it said:

    $ git config -l | grep -F 'merge.ff'
    merge.ff=false
    $ git merge --ff-only foo
    fatal: You cannot combine --no-ff with --ff-only.
On the other hand, I see that --ff works just fine in the same initial state.
    $ git merge --ff foo
    Updating b869407..17b5495
    Fast-forward
    ...
     4 files changed, 2 insertions(+), 5 deletions(-)

Would it be better if --ff-only refused to merge only if the commits themselves prevented fast-forwarding?

-- Matt McClure http://matthewlmcclure.com http://www.mapmyfitness.com/profile/matthewlmcclure

Yann Droneaud· May 22, 2013, 13:36 UTC · re: Matt McClure · lore

Re: override merge.ff = false using --ff-only

Hi,
Le 22.05.2013 15:21, Matt McClure a écrit :
Show 14 quoted lines
> I naively tried to override merge.ff = false using --ff-only on the
> command line. I expected that it would override the configured 
> default
> and perform a fast-forward merge. Instead, it said:
>
>     $ git config -l | grep -F 'merge.ff'
>     merge.ff=false
>
>     $ git merge --ff-only foo
>     fatal: You cannot combine --no-ff with --ff-only.
>
> On the other hand, I see that --ff works just fine in the same 
> initial state.
>

You might want to read the following messages from thread "git merge <tag> behavior"

http://article.gmane.org/gmane.comp.version-control.git/218519 http://article.gmane.org/gmane.comp.version-control.git/218755 http://article.gmane.org/gmane.comp.version-control.git/218786

Regards.
-- 
Yann Droneaud
OPTEYA
Junio C Hamano· May 22, 2013, 18:12 UTC · re: Matt McClure · lore

Re: override merge.ff = false using --ff-only

Matt McClure <matthewlmcclure@gmail.com> writes:
Show 20 quoted lines
> I naively tried to override merge.ff = false using --ff-only on the
> command line. I expected that it would override the configured default
> and perform a fast-forward merge. Instead, it said:
>
>     $ git config -l | grep -F 'merge.ff'
>     merge.ff=false
>
>     $ git merge --ff-only foo
>     fatal: You cannot combine --no-ff with --ff-only.
>
> On the other hand, I see that --ff works just fine in the same initial state.
>
>     $ git merge --ff foo
>     Updating b869407..17b5495
>     Fast-forward
>     ...
>      4 files changed, 2 insertions(+), 5 deletions(-)
>
> Would it be better if --ff-only refused to merge only if the commits
> themselves prevented fast-forwarding?

In general it would be better if any --ff related command line options made us ignore the configured default like merge.ff the user may have in the repository, not just --ff-only vs merge.ff combination, and your "On the other hand" demonstrates that it is the case for --ff from the command line.

I do not offhand see why --ff-only should behave differently from that expectation.

← back to recent threads