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