recipe to merge in specific git branch is instead merging HEAD

Asked by John Leach on 2017-08-01

I've created a recipe to take the standard Ubuntu package source for a package, merge in my own branch and then build it.

https://code.launchpad.net/~brightbox/+recipe/nginx-healthcheck

The upstream branch it uses is: https://code.launchpad.net/~usd-import-team/ubuntu/+source/nginx/+git/nginx/+ref/ubuntu/xenial-security

My own branch is in the git repository https://code.launchpad.net/~brightbox/nginx-healthcheck/+git/nginx-healthcheck and is named "xenial-healthcheck"

The recipe line specifies the repository and the branch as the docs say:

merge xenial-healthcheck lp:nginx-healthcheck xenial-healthcheck

but when this recipe is run, it tries to fetch a branch named HEAD rather than xenial-healthcheck, which fails because there is no branch or object named HEAD:

https://launchpadlibrarian.net/331376898/buildlog.txt.gz

The command that git-build-recipe runs is:

git fetch lp:nginx-healthcheck HEAD:refs/remotes/source-xenial-healthcheck/xenial-healthcheck refs/heads/*:refs/remotes/source-xenial-healthcheck/*

which if I run locally, outputs:

fatal: Couldn't find remote ref HEAD

I created a branch named HEAD as a duplicate of xenial-healthcheck and now the recipe builds ok.

How do I get launchpad to use the xenial-healthcheck branch and not HEAD? I want to have several recipes using different branches from this git repository, so I can't just use HEAD.

The docs do state that you specify the branch name as the third parameter to the merge command:

https://help.launchpad.net/Packaging/SourceBuilds/Recipes#Merging

Any pointers?

Question information

Language:
English Edit question
Status:
Expired
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Last query:
2017-08-01
Last reply:
2017-08-17

This question was reopened

John Leach (johnleach) said : #1

It looks like the recipe is also using HEAD from the main repository too (lp:~usd-import-team/ubuntu/+source/nginx) and not the branch I specified (ubuntu/xenial-security)

How can I get launchpad recipes to use named git branches rather than a weird branch named "HEAD" ?

John Leach (johnleach) said : #2

My question is displayed as "Solved" now but isn't solved - not sure what is going on!

Launchpad Janitor (janitor) said : #3

This question was expired because it remained in the 'Open' state without activity for the last 15 days.