Patch / branch equivalence: patches should be branches and vice versa.

Bug #345577 reported by Ted Gould on 2009-03-19
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Low
Unassigned

Bug Description

[This bug was originally filed about auto-converting patches to bzr branches. The description has since been expanded to be about converting both ways, patch-to-branch and branch-to-patch.]

When a patch is attached to a bug, it should be possible to get access to it in the form of a Bazaar branch. Likewise, when a branch is linked to a bug, it should be possible to get access to that branch in patch form (and possibly in some-other-vc-system form as well). Note that offering branches in patch or other form is not really specific to the bug tracker component: it should be possible for any branch.

The advantages of having a patch available in branch form are that it's easier to merge (If upstream uses Bazaar too, then the advantage is really big, but even if upstream doesn't, the Ubuntu packager probably does, and might need to merge the patch independently of upstream); and crediting information would automatically be in-band, instead of in some comment on the side.

The advantages of having a branch available in patch form are that patches are the lowest-common-denominator format for communicating changes -- all upstreams can accept a patch, no matter what version control system they use.

For converting patches to branches, there are few issues:

  1) determining which branch the patch should be applied against. Answer: probably the default branch for the project. If it doesn't apply successfully, have an icon to signal the failure, and by expanding the icon you could specify another branch.

  2) for Ubuntu, it's important that packages in Launchpad be related to the appropriate packaging branch so that things like debdiffs can be applied.

  3) Where to put the branch? OP's proposal: go to a user "launchpad-bugger" and made into a branch with the bug number and an incrementing number with the attachment. This takes care of the issue of multiple patches while keeping the URL short. So for most patches on project "bob" bug number 35 would result in the URL being lp:~launchpad-bugger/bob/bug35 if it had two patches you'd also have lp:~launchpad-bugger/bob/bug35-1. This would make it so that when you go to "http://code.lp.n/bob" you'd see all the bugs with patches that haven't been merged in yet, which would further encourage merging them in. Follow-up proposal, based on Andrew Bennetts' comment #1 below: lp:~bob/bug35-patch-1 (where "1" is the comment number where the patch is attached, or else a sequence number).

Naturally, one could make a merge proposal based on a branch-from-patch; they would behave like real branches in every respect.

Andrew Bennetts (spiv) wrote :

If the user attaches the output of "bzr send" rather than a plain patch, then a lot of this becomes much easier to implement. Perhaps it should be possible to "bzr send" direct to a Launchpad bug report?

Personally, I think that the automatically generated branches should be owned by the user that uploaded the patch, rather than by a robot account like "launchpad-bugger". I'm sure the Launchpad Code guys can think of a better way to give short URLs to patches on bugs, either way the branch/merge request would be be visible at code.lp.n/proj.

(Also, "bugger" is a somewhat unfortunate choice of word, at least in Australia)

Jonathan Lange (jml) wrote :

So, as Andrew says, much easier for bundles. Definitely a very cool feature idea.

Jonathan Lange (jml) wrote :

Ties in to bug 297872 as well.

Changed in launchpad-bazaar:
importance: Undecided → Low
status: New → Triaged
tags: added: code-review feature
tags: added: bug-branch-links
Jonathan Lange (jml) on 2009-09-15
tags: added: patch-tracking
Deryck Hodge (deryck) on 2009-12-08
Changed in malone:
status: New → Triaged
importance: Undecided → Low
Karl Fogel (kfogel) on 2010-03-08
summary: - Patches should be made into Bazaar branches
+ Patch / branch equivalence: patches should be branches and vice versa.
Karl Fogel (kfogel) on 2010-03-08
description: updated
description: updated
Aaron Bentley (abentley) wrote :

We already have a mechanism for turning branches into patches: merge proposals.

Bryce Harrington (bryce) wrote :

I'm nudging up this bug report's importance, because this came up in a couple of the Launchpad sessions at the last UDS. With Ubuntu moving more to use of bzr for distributed packaging, being able to get patches as branches or vice versa is more important.

Changed in malone:
importance: Low → Medium
Robert Collins (lifeless) wrote :

I'm putting this back to low because we don't use the medium bucket - if this needs escalating, please do so via the stakeholder process.

Changed in launchpad:
importance: Medium → Low
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers