I think "detached" is probably an accurate description of what is happening inside the git plugin. I suspect it has checked out the SHA1 of the remote ref as a detached head, without using a named branch. I'm not aware of any way to provide the previous behavior in the current git plugin. I'm reasonably confident tests do not exist which assert the use case you need.
It would be great if you're willing to invest effort to create unit tests of the git plugin and/or the git client plugin which describe the use case you are seeking. It would be even better if you can invest the effort to provide code in the current plugin to implement the use case you're seeking. Alternately, you might consider seeking other techniques to find that same information inside your job. There may be a git command which could take the SHA1 of the detached head and convert it into one or more remote ref names which point to that SHA1. Mark Waite On Tue, Apr 8, 2014 at 3:51 PM, Hamish Campbell < [email protected]> wrote: > Anyone able to help? > > I assume that "GIT_BRANCH" should point to the branch, so is this a bug? > > > On Tue, Apr 8, 2014 at 11:54 AM, Hamish Campbell < > [email protected]> wrote: > >> Hey all, >> >> We recently upgraded Jenkins from git-code 1.7 / git plugin 1.5 to latest >> versions (1.9.1 / 2.2.0 respectively). >> >> We're also using the GitHub pull request builder to create PR builds on >> push to git. >> >> Previously, the jenkins var GIT_BRANCH was set to the remote ref, e.g. >> "origin/pr/191/merge". After upgrading the plugin GIT_BRANCH is "detached". >> Mainline builds are still correctly marked as "master". >> >> Additionally, the jenkins API response for the build does not seem to be >> aware of the ref. In other words, before the upgrade, we had >> "origin/pr/191/merge" listed in buildsByBranchName, however we no longer >> see new PR branches appear in the build list any more. >> >> Is there a way to configure the previous behaviour for the updated plugin >> version? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Jenkins Developers" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Hamish Campbell > Koordinates Ltd <http://koordinates.com/?_bzhc=esig> > PH +64 9 966 0433 > FAX +64 9 966 0045 > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- Thanks! Mark Waite -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
