Is "bzr push" safe?
INADA Naoki
songofacandy at gmail.com
Wed Nov 30 07:04:41 UTC 2011
I love mainline too.
FWIW, I usually use checkout of remote branch and separated local branch.
In this way, merge & commit on checkout syncs to remote branch.
So I use "push" only when I want to share my local branch to others.
Pushing to a remote branch is safe when any others doesn't push to the branch.
On Wed, Nov 30, 2011 at 3:49 PM, Lalo Martins <lalo.martins at gmail.com> wrote:
> 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/
>
>
--
INADA Naoki <songofacandy at gmail.com>
More information about the bazaar
mailing list