[Development] [IMPORTANT] your commits in stable branch perhaps lost after dev branch merged

Olivier Goffart olivier at woboq.com
Thu Mar 21 18:42:00 CET 2013

On Thursday 21 March 2013 17:16:36 Qi Liang wrote:
> > Merging is not an easy task. (I know it, I was doing the merge during Qt
> > 4.x times)
> > It is easy for someone unexperimented to mess up.
> > Which is why I think only experimented developer should do the merge.
> Not that easy like Qt 4.x ages(we only have 1 repo, 

Having 1 big repo was not a good thing.

The modularisation simplifies the marges because each merge is smaller,  and 
also made by different people who knows the code base of their repository 

> and we could do that merge per week or per month, or just before a release),

I was doing the merge at least once a week.

> now we have about 10 repos, and after open governance, changes are more. And
> sometimes, a merge depends on another merge(just like qtdeclarative depends
> on qtbase).

Dependencies should only go one way.
(qtdeclarative depends on qtbase, but not the other way around)

> stable->dev merges happened like daily.

They don't. Check the history, it is more like once a week or less.

> > A merge is between two branches.   And the merge operation is commutative.
> > 
> > Think about it like:
> >    merge(stable , dev) == merge (dev, stable)
> > 
> > // usually
> > tmp = merge(stable, dev);
> > dev = tmp;
> >
> > // this time
> > tmp = merge(stable, dev);
> > stable = tmp;
> // usually or before
> stable = stable; // 4.x-1
> dev = merge(stable, dev); // 4.x, stable->dev
> // this time
> stable = merge(dev, stable); // dev->stable
> dev = stable;
> // then here you can see stable doesn't have much meaning when release cycle
> is short enough.

Merge are commutative.
  merge(stable, dev) == merge(dev, stable)

Think of it like a  '+'
  3 + 8 == 8 + 3

 stable = merge(dev, stable);
 stable = merge(stable, dev);
are exactly the same thing. [1]

The only difference between this merge and the other merge is the branch to 
which it was commited, and the one who made the merge.
The merge is no bigger than usual, and no more complicated.
On the contrary, it was even smaller because the last stable->dev was 

[1] It actually has some difference, like the order of the chunks when one need 
to resolve the conflicts, but the resulting operation should be the same.

More information about the Development mailing list