Pushing after merge considered harmful

Eli Zaretskii eliz at gnu.org
Tue Jan 26 11:06:01 GMT 2010


> From: Alexander Belchenko <bialix at ukr.net>
> Date: Tue, 26 Jan 2010 11:20:05 +0200
> 
> This option works on the individual branch level, not at the repo level.

But then it needs to be set for every branch in the repo for which we
want it, right?

> I will try to explain the option, but I'm not native Englishman.

I read Russian, if you prefer (though others here might not be
amused ;-).  But you have nothing to be embarrassed for about your
English.

> It prevents push to change revno for existing revisions in the branch.

See, that's what confuses me about the description in the docs: a
"revno" is just a number of a revision.  It is not the revision
itself.  A revision, AFAIU, is a node in the history DAG.  So why are
you talking about the revno? do you really mean the revision number,
or do you mean the revision itself?

> So if you do:
> 
> bzr branch url/to/foo
> cd foo
> # hack-hack-hack
> bzr commit -m "my hacks"
> bzr push
> 
> then push will works, because your commits are direct children of the 
> branch tip.
> 
> But if you do:
> 
> bzr branch url/to/foo
> cd foo
> # hack-hack-hack
> bzr commit -m "my hacks"
> # rats, can't push because branches diverged
> # but what about merge?
> bzr merge url/to/foo
> bzr commit -m "merge trunk :-)"
> bzr push
> 
> Then push won't work (with append option set) because in the result the 
> mainline history will change: your local commits become mainline, and 
> diverged mainline become merged (dotted) revisions.

What if I first merge _into_ url/to/foo?  Suppose I have a branch that
is a mirror of url/to/foo, let's call it mirror.  That is:

  bzr branch --bind url/to/foo mirror
  bzr branch mirror foo
  cd foo
  # hack-hack-hack
  bzr commit -m "my hacks"
  cd ../mirror
  bzr up
  cd ../foo
  bzr merge
  bzr commit -m "merge from trunk"
  # hack-hack-hack
  bzr commit -m "more hacks"
  cd ../mirror
  bzr merge ../foo
  bzr commit "merged feature foo"

will this work with the append option set?  If not, what is the proper
workflow for feature branches and a bound trunk mirror, under the
append option?

> Also `push --overwrite` won't work if branches are diverged.
> 
> Also this option prevents uncommit for this branch. (Again because it 
> will change mainline history).

The latter of these two sounds like a loss in important functionality.

Thanks.



More information about the bazaar mailing list