[PATCH 0 of 1] merge: add --no-fast-forward to suppress fast-forward merge

Yuya Nishihara yuya at tcha.org
Sun Mar 6 11:15:10 UTC 2011


Didly wrote:
> On Sun, Mar 6, 2011 at 11:24 AM, FUJIWARA Katsunori
> <fujiwara at ascade.co.jp>wrote:
> 
> > The behavior of Mercurial on merge between named branches is changed
> > to 'fast-forward' style since 1.8 by 9e7e24052745.
> >
> > There is quite a few people who requires 'old'(= not fast-forward)
> > style merge, but there is no way to choose 'old' style on merge.
> >
> > So, I tried to implement experimental patch to add '--no-fast-forward'
> > option.
> >
> > This patch is just implemented for base of discussion: no enough
> > coverage, not well tested :-)
> >
> >  - is there few people who requires such 'old' style merge ?
> >
> >  - which should default behavior of merge be fast-forward or not ?
> >
> >  - does my patch have enough coverage ?
> >
> >      I have just checked (directly/in-directly) invocations of
> >      merge()@hg.py and update()@merge.py in mercurial core and hgext.
> >
> >  - are there any other good solutions ?
> >
> >  - and so on....
> >
> > Please comment on !
> >
> >
> > BTW, I cannot find out any documentation about introducing of
> > fast-forward merge in 1.8 release artifacts. Does this confuse
> > existing users ?
> 
> Actually this is the first I've heard of it and I don't really know what it
> means. Is it related to merging with a descendant?
> Anyway, I guess it does confuse at least some existing users :-)

AFAIK, it happens when pseudo-merging with another named branch.

In the following repository, if you merge 'default' branch with 'stable':
o  1 tip stable d22578dc6cbe
|    add bar
|
@  0 default 8e8497c544c1
     add foo

Mercurial <= 1.7.5 creates real merge changeset:
@    2 tip default :0,1 977f0fda89b9
|\     merge with stable
| |
| o  1 stable d22578dc6cbe
|/     add bar
|
o  0 default 8e8497c544c1
     add foo

But Mercurial 1.8 creates new empty commit to mark default branch:
@  2 tip default dd9675ad136d
|    merge with stable
|
o  1 stable d22578dc6cbe
|    add bar
|
o  0 default 8e8497c544c1
     add foo

Yuya,



More information about the Mercurial-devel mailing list