← Back to team overview

graphite-dev team mailing list archive

'bzr push' considered harmful

 

Hey everyone, I just wanted to make a quick public service announcement
that doing 'bzr push lp:graphite' from your own branch is a very bad thing
to do, despite it appearing to be innocuous/correct. There are safe ways to
use 'bzr push', but unless you already know how to do it, just avoid using
'bzr push' altogether. In the past this has caused lost commits and screwed
up the revision history on multiple occasions. If you checked out trunk
earlier today it's possible that your checkout is missing commits, please
re-check it out because I just fixed the issue by repushing the state of
trunk from last night, rev 621.

Instead of 'bzr push', here's the workflow I recommend using.

Always have a trunk checkout. (bzr checkout lp:graphite graphite-trunk)
Do all non-trivial work on a branch. (bzr branch lp:graphite
graphite-mybranch)
When you want to merge 'graphite-mybranch' to trunk, do it like this:

cd graphite-mybranch
bzr merge lp:graphite
#resolve any merge conflicts
bzr commit -m "merging in lp:graphite revs X..Y"
cd ../graphite-trunk
bzr update
bzr merge lp:~me/graphite-mybranch
#there should be *no* conflicts, if there are, stop.
bzr commit -m "merging in lp:~me/graphite-mybranch"

The idea is to ensure your branch sanely merges with trunk by first merging
trunk to your branch. Then merging your branch back to trunk leaves a
single high-level commit in trunk, with detailed commit history still
available if needed (bzr log --includes-merges). Also please be sure to
always include your branch's lp: url in the commit message when merging to
trunk.

If you are ever unsure about the procedure or just don't want to mess with
bzr, just propose merging your branch to trunk on launchpad. I will gladly
do the merge for you after a review.

Thanks,
Chris

Follow ups