How do you make merge proposals in git for Launchpad?

Asked by Darren Hoyland

Hi,

Sorry for another question so soon after asking how to actually set up a git repository, but now I'm trying to work out how to make merge proposals or pull requests via http://git.launchpad.net/.

The blog entry at http://blog.launchpad.net/general/git-code-hosting-beta says that you now support "propos[ing] merges from one branch to another", but I can't see an obvious way of doing this via the UI and no documentation yet on how to do this via the cli.

I've pushed two branches up to my repo, so now I'd like to make an MP - please can you let me know how, or direct me to where I can find further instructions on how to do this.

Thanks again!

Question information

Language:
English Edit question
Status:
Solved
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Solved by:
Darren Hoyland
Solved:
Last query:
Last reply:
Revision history for this message
Colin Watson (cjwatson) said :
#1

You have to start from the repository page on code.launchpad.net, not git.launchpad.net (hopefully soon we'll have a link from the latter to the former, but in the meantime you can just change the domain in the URL; longer-term we'll consolidate these two). From there, follow the link to the branch you want to merge from, and then you'll see a "Propose for merging" link.

You'll have to type the target branch name into the resulting form at the moment; that's a known UI weakness we haven't had time to sort out yet. Otherwise from here it should work rather like it does for Bazaar branches. There are a few bits and pieces that we're still hooking up: the "conversation" view of a merge proposal that interleaves comments and new revisions doesn't work yet, preview diffs won't update when you push new revisions, and merge proposals aren't yet automatically set to Merged.

Revision history for this message
Darren Hoyland (autonomouse) said :
#2

Right I see it now. Just to reiterate for anyone else stumbling across this:

In https://code.launchpad.net/<projectname>, at the top right of the page is a "View Git repositories" link. Clicking it takes you to https://code.launchpad.net/<projectname>/+git

From here, you click on the branch name you wish to merge, then click on "Propose for merging" then proceed as you would for bzr, only adding 'master' (or whatever ) into the "Target reference path".

Cheers Colin!

Revision history for this message
Marko Stanković (sm4rk0) said :
#3

I'm sorry, but I need clarification about what's source and what's target repo in this case.

This is what I did:

1. I cloned this branch to my computer:
https://code.launchpad.net/~ubuntu-kernel/ubuntu/+source/initramfs-tools/+git/initramfs-tools/+ref/ubuntu
using this command:
git clone -b ubuntu git+ssh://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/initramfs-tools

2. Then I've made changes to one file, committed and pushed them to my repo:
https://code.launchpad.net/~sm4rk0/initramfs-tools/+git/initramfs-tools/+ref/ubuntu

Obvious (to me) following steps would be:

3. Selecting "Propose for merging" from my branch and choosing the original repo as the target with "ubuntu" as the reference path. BUT there's no "Propose for merging" link on my repo, so I tried the opposite way. Starting from original repo's "Propose for merging" link I selected my repo as a target but got an error message that repositories can't merge. Then I tried a little hack: appended the "+register-merge" to my repo's URL and, voilà! There was the "Propose for merging" form. But it also gave me the same error (just the opposite way).

Please help!
Marko

Revision history for this message
William Grant (wgrant) said :
#4

Those repositories can't be merged because they're in different places: the first is in "ubuntu/+source/initramfs-tools", the initramfs-tools package in Ubuntu, while the second is in "initramfs-tools", the upstream initramfs-tools project. If you push to lp:~sm4rk0/ubuntu/+source/initramfs-tools instead you'll be able to merge into the Ubuntu package repo.

Revision history for this message
Marko Stanković (sm4rk0) said :
#5

That worked. Thank you for your quick answer!

Revision history for this message
fermulator (fermulator) said :
#6

Yeah, this is frustrating for a new user.

https://help.launchpad.net/Code/Git talks about these git vs. code URLs. (once I figure out why launchpad ubuntu-one isn't associating login, i'll try to fix/improve)

Is there a bug report for adding the cross-linkage to/from the two URL pathings? This would be super useful.

PS: as an aside/funny, things were further confounded for me because I had the LP #bug in my git branch which works in git. naming, but not code. naming -- https://bugs.launchpad.net/launchpad/+bug/1787965