Hierarchical history with solo project

Asked by Pinku Surana

[I'm a newbie] I am using bzr for a solo project. I have a MAIN branch and a DEV branch. I made lots of small commits on DEV to complete a feature: [4,5,6]. I call "bzr merge" but it says "Nothing to do" because MAIN hasn't changed. I call "bzr push" to move my changes into MAIN. According to the log, bzr appends the revision numbers onto MAIN so it's sequential: [1,2,3,4,5,6]. I would really like to keep the small commits separate so the log for MAIN is concise. I would prefer the log look like [1,2,3,4 merge]. And the small commits should use dotted notation: [1,2,3,4 merge, 1.1.1, 1.1.2, 1.1.3].

In short, I want hierarchical history as described here (http://doc.bazaar.canonical.com/bzr.2.4/en/user-guide/zen.html#hierarchical-history-is-good) for a solo project where all the work is done on branches, not on the MAIN branch. But bzr won't do it unless there's been a change on MAIN worth merging. Is there a way to make this work?

[edit] I think I want the behavior of "git merge --no-ff branch" as described in git-flow: (http://nvie.com/posts/a-successful-git-branching-model/) "Incorporating a finished feature on develop".

Question information

Language:
English Edit question
Status:
Answered
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Vincent Ladeuil (vila) said :
#1

Instead of pushing your changes to MAIN, you want to merge your
DEV branch into MAIN or any branch for that matter.

I.e.:

$ bzr branch MAIN cool-feature
$ cd cool-feature
$ hack; hack;
$ bzr commit -m 'cool-feature done'
$ cd ../MAIN
$ bzr merge ../cool-feature
# resolve conflicts if any
$ bzr commit -m 'cool-feature added'

and you'll get exactly the history you wanted.

Revision history for this message
Jelmer Vernooij (jelmer) said :
#2

On Wed 07 Sep 2011 03:45:47 PM CEST, Pinku Surana wrote:
> New question #170429 on Bazaar:
> https://answers.launchpad.net/bzr/+question/170429
>
> [I'm a newbie] I am using bzr for a solo project. I have a MAIN branch and a DEV branch. I made lots of small commits on DEV to complete a feature: [4,5,6]. I call "bzr merge" but it says "Nothing to do" because MAIN hasn't changed. I call "bzr push" to move my changes into MAIN. According to the log, bzr appends the revision numbers onto MAIN so it's sequential: [1,2,3,4,5,6]. I would really like to keep the small commits separate so the log for MAIN is concise. I would prefer the log look like [1,2,3,4 merge]. And the small commits should use dotted notation: [1,2,3,4 merge, 1.1.1, 1.1.2, 1.1.3].
>
> In short, I want hierarchical history as described here (http://doc.bazaar.canonical.com/bzr.2.4/en/user-guide/zen.html#hierarchical-history-is-good) for a solo project where all the work is done on branches, not on the MAIN branch. But bzr won't do it unless there's been a change on MAIN worth merging. Is there a way to make this work?
You should run the "bzr merge" command in the MAIN branch rather than
in the DEV branch.

If you run "bzr merge DEV" there, and commit that change you will get
the behaviour you're after.

Cheers,

Jelmer

Can you help with this problem?

Provide an answer of your own, or ask Pinku Surana for more information if necessary.

To post a message you must log in.