
2013/6/25 Martin Owens <doctormo@...400...>:
On Tue, 2013-06-25 at 19:52 +0200, Krzysztof Kosiński wrote:
In fact merging from trunk from time to time is encouraged, because it allows you to keep up to date and reduces the risk of surprise bugs appearing only after the final merge.
For separate branches, that's right. But if he's working from trunk then a push doesn't run a 'merge' on the remote branch, it replaces the revision history. At least, that's what happens from experience.
Push will always fail if the target branch has any revisions not present in the source branch. As such, push *never* removes revisions, it can at most change their numbering (unless you use the --overwrite option). So it is not like replacing the revision history.
Renumbering will happen only if the source branch has a different primary path in the revision graph than the target branch. The "primary path" consists of the revisions committed directly to that branch - e.g. all revisions merged from other branches are not numbered. The append-only option, which is enabled on Inkscape trunk, disallows this kind of pushes.
2013/6/26 Christoffer Holmstedt <christoffer.holmstedt@...400...>:
hmm, this is what have been bugging me. That is the workflow I'm used to from git but I got the feeling that I should NEVER merge trunk into one of my feature branches because that would mess up earlier revisions later on in trunk (not sure how though). I will have to set up a new project locally and try it out for myself, that's the best way to learn =)
I don't like to work out of trunk, always branch to a bugfix branch or feature branch. As a response to the checkout/branch difference, yes got that one (I'll stay away from checkouts).
Some clarification, once more:
1. Bazaar does not allow you to push a branch if it's diverged - e.g. a push only allows you to add revisions, never remove them.
2. However, sometimes pushing a branch will renumber revisions, because the pushed branch has a different primary path in the revision graph. This will happen only in one case: when you branch from trunk, add some commits, merge from trunk, then push the resulting branch as the new trunk. We have disallowed such pushes. You should always merge the feature commits *into* the branch you're pushing to trunk. This does *not* mean that merges from trunk to feature branches are disallowed, only that the last merge should be in the direction feature -> trunk.
3. If you work with remote branches which you share from a machine different than your own, for instance on Launchpad, it's far more convenient to work with checkouts of the remote, shared branches than push your local branch to the remote branch every time you make a commit. Basically, Bazaar extends the Git paradigm by allowing to you to work directly on the remote branch. There is no reason to avoid checkouts.
Regards, Krzysztof