Diff for "FeatureHighlights/EasyBranching"

Not logged in - Log In / Register

Differences between revisions 4 and 5
Revision 4 as of 2007-03-25 15:00:01
Size: 4329
Editor: 81
Comment:
Revision 5 as of 2007-03-27 10:25:02
Size: 4375
Editor: 217
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
For this section of the reviewers guide, you can actually create and publish a branch or two if you'd like. You'll need Bzr installed, and to have SSH keys which you can give to Launchpad to authenticate yourself. Alternatively, just read over the text to get a sense of what's possible. For this section of the reviewers guide, you might like to actually create and publish a branch or two. You'll need to have Bzr installed and to have registered SSH keys with Launchpad, which you can use to authenticate yourself.
Line 5: Line 5:
If you want to try out the examples here then you will need to have Bazaar (bzr) installed on your machine. For Ubuntu users, just type "sudo apt-get install bzr" and you will be all set. For users of other platforms, take a look at [http://bazaar-vcs.org/Download these instructions] to install Bzr for yourself. For Ubuntu users, simply type "sudo apt-get install bzr" and you will be all set. For users of other platforms, take a look at [http://bazaar-vcs.org/Download these instructions] to install Bzr for yourself.
Line 7: Line 7:
You should have at least version 0.15 of Bzr installed: You should have at least version 0.15 of Bzr installed. To check:
Line 9: Line 9:
 {{{ {{{
Line 14: Line 14:
Now, let's branch the famous "GNU Hello" application, which is used as a demonstration of several GNU best practices and technologies. Note, for simplicity we will use HTTP to fetch the code for this branch, but this is quite an inefficient protocol for this purpose so it takes a little longer than normal to fetch the code. You can also use the optimised smart server protocol, once you have setup some keys to access the Launchpad server securely. We use HTTP here because it can be done anonymously. Alternatively, just read over the text to get a sense of what's possible.

=== Creating your branch ===

Now, let's create a branch of the famous "GNU Hello" application, which is used as a demonstration of several GNU best practices and technologies.

F
or simplicity we will use HTTP to fetch the code for this branch. This is quite an inefficient protocol, for this purpose, so it takes a little longer than normal to fetch the code. You can also use the optimised smart server protocol, once you have registered your SSH keys to access the Launchpad server securely.

We use HTTP here because it can be done anonymously.
Line 32: Line 40:
You can see the latest commits on this branch (this is a branch of the trunk, so it has all the latest commits that trunk had when it was branched. You can see the latest commits on this branch. This is a branch of the trunk, so it has all the latest commits that trunk had when you created the branch.
Line 51: Line 59:
Because this is YOUR branch, you can commit to it immediately. Try making some changes and typing "bzr commit". Before doing this, you might want to configure Bazaar so that it knows who you are, and records that information with each commit. Type "{{{bzr whoami 'Joe Smith <email@domain.com>'}}}" to set that up. === Making changes to your branch ===

Because this is YOUR branch, you can commit to it immediately. Try making some changes, then type "bzr commit".

Before doing this, you can optionally configure Bazaar so that it knows who you are, and records that information with each commit. Type "`bzr whoami 'Joe Smith <email@domain.com>'`" to set that up.
Line 55: Line 67:
If you have [https://launchpad.net/people/+me/+editsshkeys:given Launchpad some SSH keys for yourself] then you can publish your branch with a single command. You need to know the project name in Launchpad, and your own username, and of course the name you want to give this branch. If your branch is just a personal one, that should not show up for a specific project, you can call it "junk" and use {{{+junk}}} instead of the project name. If you have [https://launchpad.net/people/+me/+editsshkeys set up some SSH keys in your Launchpad account], you can publish your branch with a single command.

You need to know the project name in Launchpad, your own Launchpad username, and of course the name you want to give this branch. If your branch is for personal use, and you don't want it to be listed in a specific project, you can call it "junk". Simply use {{{+junk}}} instead of the project name.
Line 71: Line 85:
It may seem strange that you need your account name TWICE in the publishing command given above. The reason is that the first time (account@...) is to tell Launchpad who you are logging in as. The second time (~account/) is to tell it to put the branch into *your* directory. This is needed because you can also publish branches into directories for each of the teams in which you are a member. And that leads us to the next stop on our tour - [:ReviewersGuide/TeamBranches:Team Branches]! It may seem strange that you need your account name TWICE in the publishing command given above. The reason is that the first time (account@...) is to tell Launchpad who you are logging in as. The second time (~account/) is to tell it to put the branch into *your* directory.

This is needed because you can also publish branches into directories for each of the teams of which you are a member. And that leads us to the next stop on our tour - [:ReviewersGuide/TeamBranches:Team Branches]!

Creating branches

For this section of the reviewers guide, you might like to actually create and publish a branch or two. You'll need to have Bzr installed and to have registered SSH keys with Launchpad, which you can use to authenticate yourself.

For Ubuntu users, simply type "sudo apt-get install bzr" and you will be all set. For users of other platforms, take a look at [http://bazaar-vcs.org/Download these instructions] to install Bzr for yourself.

You should have at least version 0.15 of Bzr installed. To check:

% bzr version
Bazaar (bzr) 0.15.0candidate2

Alternatively, just read over the text to get a sense of what's possible.

Creating your branch

Now, let's create a branch of the famous "GNU Hello" application, which is used as a demonstration of several GNU best practices and technologies.

For simplicity we will use HTTP to fetch the code for this branch. This is quite an inefficient protocol, for this purpose, so it takes a little longer than normal to fetch the code. You can also use the optimised smart server protocol, once you have registered your SSH keys to access the Launchpad server securely.

We use HTTP here because it can be done anonymously.

  • % bzr branch http://launchpad.net/gnuhello
    Branched 191 revision(s).

Done! You now have your own branch of GNU Hello.

  • % cd gnuhello
    % ls
    ABOUT-NLS   ChangeLog     COPYING  Makefile.am  README        tests
    AUTHORS     ChangeLog.O   doc      man          README-alpha  THANKS
    autogen.sh  configure.ac  gnulib   NEWS         README.dev    TODO
    build-aux   contrib       INSTALL  po           src

You can see the latest commits on this branch. This is a branch of the trunk, so it has all the latest commits that trunk had when you created the branch.

  • % bzr log | head --lines=13
    ------------------------------------------------------------
    revno: 191
    committer: karl
    timestamp: Tue 2007-02-13 23:09:30 +0000
    message:
      .
    ------------------------------------------------------------
    revno: 190
    committer: karl
    timestamp: Mon 2007-01-22 14:40:04 +0000
    message:
      update from texinfo
    ------------------------------------------------------------

Making changes to your branch

Because this is YOUR branch, you can commit to it immediately. Try making some changes, then type "bzr commit".

Before doing this, you can optionally configure Bazaar so that it knows who you are, and records that information with each commit. Type "bzr whoami 'Joe Smith <email@domain.com>'" to set that up.

Publishing branches

If you have [https://launchpad.net/people/+me/+editsshkeys set up some SSH keys in your Launchpad account], you can publish your branch with a single command.

You need to know the project name in Launchpad, your own Launchpad username, and of course the name you want to give this branch. If your branch is for personal use, and you don't want it to be listed in a specific project, you can call it "junk". Simply use +junk instead of the project name.

Continuing our example above, we will push this GNU Hello branch to Launchpad with the command:

  • % bzr push sftp://<me>@bazaar.launchpad.net/~<me>/gnuhello/mine

Of course, you must substitute your Launchpad username for <me> in both places in the above command.

Now, if you take a look at your own branch listing page, you will see the GNU Hello branch listed:

As you can see, branching from an existing project, and publishing your branch, are extremely easy. Once your branch is published it is easy for others to find. If you would like your code to be included in the project's official line of development (and hence in the next release!) you can simply ask the project maintainers to review and merge your branch.

It may seem strange that you need your account name TWICE in the publishing command given above. The reason is that the first time (account@...) is to tell Launchpad who you are logging in as. The second time (~account/) is to tell it to put the branch into *your* directory.

This is needed because you can also publish branches into directories for each of the teams of which you are a member. And that leads us to the next stop on our tour - [:ReviewersGuide/TeamBranches:Team Branches]!

FeatureHighlights/EasyBranching (last edited 2011-07-01 15:01:18 by 83)