git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Can't squash merge with merge.ff set to false

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jan 6, 2018, 00:11 UTC
Message-ID
<20180106001131.GA54183@aiede.mtv.corp.google.com>
In-Reply-To
<CAHd499C=3Y-ykgYZhSJzk=e-Pi6BUFeN8C89krd5T7T5fRB91g@mail.gmail.com>
Hi,
Robert Dailey wrote:
Show 9 quoted lines
> Not sure if this is intended or a bug, but with the following configuration:
>
> $ git config --global merge.ff false
>
> I am not able to merge my topic branch into master with squash option:
>
> $ git checkout master
> $ git merge --squash topic
> fatal: You cannot combine --squash with --no-ff.
I see two issues here:
 1. The check and error message really only make sense when you passed
    --no-ff directly, not implicitly using config.  The problem you
    are running into was presumably introduced when merge.ff was added
    in v1.7.6-rc0~67^2~1 (2011-05-06).
 2. Whether it comes from an alias or config, --no-ff and --squash are
    not fundamentally incompatible.  --no-ff says not to do something
    and --squash says to do a different thing, so --squash should win.

So I suspect that making --squash override --no-ff would be a reasonable behavior.

Care to write a patch?

Thanks, Jonathan

Previous: Robert Dailey
Message 7 of 7 in “Can't squash merge with merge.ff set to false”
  1. Robert DaileyJan 5, 2018
  2. Bryan TurnerJan 5, 2018
  3. Paul SmithJan 5, 2018
  4. Robert DaileyJan 5, 2018
  5. Bryan TurnerJan 5, 2018
  6. Robert DaileyJan 5, 2018
  7. Jonathan NiederJan 6, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.