Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

With a Git/GitHub background and knowing very little about Bazaar VCS, I would like to occasionally report a bug to projects hosted on Launchpad, and even send a patch. I'd like to do it in a "proper" way so that it's ready for merging or improvement while not getting in way.

I can't seem to find a decent simple How-to suited for my needs.

What I did so far:

  1. I have created a Launchpad account,

  2. reported the bug,

  3. installed Bazaar and setup SSH keys etc.

Now if it was GitHub, I'd

  1. fork the repo,

  2. clone the forked repo,

  3. create a sanely named branch and do the work,

  4. commit + push,

  5. create a pull request using GitHub WUI.

But it's not GitHub, and both Launchpad and Bazaar architectures seem quite different from their GitHub/Git counterparts.

So could a kind soul save me from drowning in tons of documents and compile a straightforward step path, mainly the second part? Possibly including relevant CLI commands when they are needed?


Edit: It seems that I should clarify if I'm asking specifically about Ubuntu packages (whatever it means) or Launchpad projects.

I don't really care much about distinction between Ubuntu packages and non-Ubuntu packages. Any software could be in Ubuntu today and out of it tomorrow, or vice-versa. The development is what matters much more than distribution.

So I was assuming that

  • not every single package distributed in Ubuntu is hosted on Launchpad,

  • an "official" or "default" workflow for Launchpad exists (well if all devs can agree on using Bazaar, why couldn't most of them agree on a patching workflow?),

so I'm asking about the Launchpad way, not the Ubuntu way. And I chose AU because since the intersection is vast, I guess it's pretty on topic here.

share|improve this question
    
does this short document help? if so please feel free to expand the existing answer as necessary doc.bazaar.canonical.com/bzr.dev/en/mini-tutorial –  d3vid Nov 20 '13 at 8:30
    
add comment

2 Answers

Is it a Launchpad project?

(If you already know that it is a Launchpad project, you can skip this.)

Not all projects found on Launchpad are actually hosted and developed there - some are mirrors of code hosted elsewhere (GitHub/Gitorious/etc), others come from Debian. These original sources are known as "upstream" projects, and it is usually best to submit patches at the source and let the changes arrive "downstream" in Ubuntu (usually in the next release).

It should be clearly indicated on the project page whether it is hosted elsewhere or on Launchpad. If not, just ask the project maintainers how they wish to receive changes. Some upstream projects prefer simple patch files, others prefer submissions/pushes via their respective hosts.

As a special note, official Ubuntu packages (software stored in the official Ubuntu repositories that you can install from the Software Center) have a few different ways to submit patches, as many of those packages come directly from Debian, and should ideally be fixed there rather than only in Ubuntu. (This is a whole other question.)

How to submit a patch

The general way to submit a patch is that you make your branch, commit to it locally and push it back to Launchpad:

bzr push lp:~user/project/branch-name

You can then propose your branch to merge into the parent you branched from, either via the web site, or using the bzr lp-propose command.

If you've filed a bug, and your branch does fix it, be sure to do the following when committing, where 000000 is replaced with your bug number, assuming it is a bug reported on Launchpad, and not elsewhere instead.

bzr commit --fixes=lp:000000

A note on "default" workflow

This is pretty much the typical modern workflow, that you may compare to GitHub. Launchpad has been around a bit longer though, so this workflow evolved after the fact, rather than being built into the system from the beginning, so some older projects may rely on other methods of accepting patches. Most all newer projects rely on this workflow though, where on GitHub the "pull requests" have always been there, and people just default to using it because there was never a means to do something different on GitHub.

share|improve this answer
add comment

Intitial answer based on dobey's answer here and Jorge Castro's answer to a project-specific question. Edits/corrections/suggestions welcome.

  1. Create a Launchpad account. This will include a Launchpad username (YOUR-LAUNCHPAD-USERNAME)

  2. Add your ssh key to launchpad at https://launchpad.net/~LAUNCHPAD-USERNAME/+editsshkeys

  3. On Launchpad, note the project name (PROJECT-NAME).

  4. Report the issue against the project. The issue will be assigned a bug number (000000).

  5. Make sure Bazaar is installed dpkg-query -l bzr. You may want to read up on Bazaar / Launchpad integration

  6. configure bzr with bzr whoami "Your Name <name@example.com>" and bzr launchpad-login LAUNCHPAD-USERNAME

  7. On your machine, check out a local branch of the project

    bzr branch lp:PROJECT-NAME

    (This will create a folder called PROJECT-NAME containing the latest project code.)

  8. Get the project running. Make changes. Test your changes. (These steps are project- and issue-specific.)

  9. Commit your changes, including the bug number (000000).

    bzr commit --fixes=lp:000000

  10. That will open a commit dialog where you can add a changelog entry explaining your changes.

  11. Push your changes to Launchpad. (This will create a new remote branch associated with your account.)

    bzr push lp:~YOUR-LAUNCHPAD-USERNAME/PROJECT-NAME/NEW-BRANCH-NAME

    (NEW-BRANCH-NAME should be a short descriptive name of the issue fixed / feature added)

  12. Open branch in your browser with bzr lp-open or by going to https://code.launchpad.net/~YOUR-LAUNCHPAD-USERNAME/PROJECT-NAME/NEW-BRANCH-NAME/

  13. Propose a merge with bzr lp-propose or from the URL in the last step by selecting "Propose for merging", adding a description, paste in lp:PROJECT-NAME for the branch you want to propose into and click "Submit".

share|improve this answer
    
Question: If my "project name" is ubuntu/saucy/msttcorefonts am I doing bzr push lp:~amandabee/ubuntu/saucy/msttcorefonts/actualbranchname or just bzr push lp:~amandabee/msttcorefonts/actualbranchname –  Amanda Feb 24 at 17:11
    
The former: bzr push lp:~amandabee/ubuntu/saucy/msttcorefonts/actualbranchname worked –  Amanda Feb 24 at 17:18
    
@Amanda thanks! –  d3vid Feb 25 at 7:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.