Is "bzr push" safe?

Lalo Martins lalo.martins at gmail.com
Wed Nov 30 06:49:54 UTC 2011


quoth Martin Pool as of Wed, 30 Nov 2011 11:57:49 +1100:
> 
> bzr branch trunk feature
> bzr ci trunk -m 'foo' --unchanged    # makes r100 on trunk bzr ci
> feature -m 'feature 1' --unchanged    # makes a different r100 on
> feature bzr push -d feature trunk   # fails because they are diverged
> bzr merge -d feature trunk && bzr ci -m "merge trunk" feature   # now
> feature's r101 includes both
> bzr push -d feature trunk
> 
> This last command succeeds, but now r100 on trunk is different to what
> it used to be.  'bzr log -n0' on trunk will show it has moved off to the
> side and the 'feature' history is primary.

FWIW, this is not a problem specific to bzr. If you do exactly the same 
in git, you get exactly the same results. However, it seems to be a 
common workflow in that world to do

git pull
hack hack hack
git commit
git merge
git push

which essentially does the same thing, and causes the log to be full of 
spurious merges and dozens of copies of some commits. It drives me crazy. 
I don't know if this is a technical +1 for bzr, or a +1 for bzr for the UI 
simply being less confusing, or just a case of bzr users being more 
careful on average. IMO git fails badly in any workflow other than the 
one it was designed for. But let's not turn this into a git-bashing 
session; the point was, this problem is not unique to bzr, and it may be 
inherent to distributed VCs that allow history to be rewritten.

tl;dr it's unsafe to push a branch over a different branch, on any VC. 
You don't lose data but the log display goes weird.


best,
                                               Lalo Martins
-- 
          Now go and make your dreams inevitable.
                  http://lalomartins.info/
GNU: never give up freedom              http://www.gnu.org/




More information about the bazaar mailing list