jenkinsci / jenkinsci/git-plugin
[JENKINS-17099] "Branch to merge to" should accept environment variables especially ${GIT_BRANCH}
- Dominant language
- Java
- Stars
- 694
- Forks
- 1.1k
- Avg merge
- 1h 29m
- Merged PRs (30d)
- 3
Description
What I want to do is to give jenkins two git repos (local, remote)
and make him build every commit in any branch from local, for each of them merge with the same branch from remote.
so my branch spec is local/**
and before build I want to merge with remote with the same branch. local is a clone of remote, and they get synchronized often.
Where i failed is that i specified in "Branch to merge to" value ${GIT_BRANCH}, but this didn't get resolved, and i saw
------------
Merging Revision 71130601881ca2da83c7969e5a21093f5accbe28 (local/master) onto ${GIT_BRANCH}
FATAL: Command "git rev-parse unfuddle/${GIT_BRANCH}^
{commit}" returned status code 128:
stdout: unfuddle/local/master^{commit}
stderr: fatal: ambiguous argument 'unfuddle/local/master^
{commit}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
hudson.plugins.git.GitException: Command "git rev-parse unfuddle/${GIT_BRANCH}^{commit}
" returned status code 128:
stdout: unfuddle/local/master^
{commit}
stderr: fatal: ambiguous argument 'unfuddle/local/master^{commit}
': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
---
Originally reported by
kretes, imported from: "Branch to merge to" should accept environment variables especially ${GIT_BRANCH}
Raw content of original issue
What I want to do is to give jenkins two git repos (local, remote)
and make him build every commit in any branch from local, for each of them merge with the same branch from remote.so my branch spec is local/**
and before build I want to merge with remote with the same branch. local is a clone of remote, and they get synchronized often.
Where i failed is that i specified in "Branch to merge to" value ${GIT_BRANCH}, but this didn't get resolved, and i saw
------------
Merging Revision 71130601881ca2da83c7969e5a21093f5accbe28 (local/master) onto ${GIT_BRANCH}
FATAL: Command "git rev-parse unfuddle/${GIT_BRANCH}^
{commit}" returned status code 128:
stdout: unfuddle/local/master^{commit}stderr: fatal: ambiguous argument 'unfuddle/local/master^
{commit}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
hudson.plugins.git.GitException: Command "git rev-parse unfuddle/${GIT_BRANCH}^{commit}" returned status code 128:
stdout: unfuddle/local/master^
{commit}
stderr: fatal: ambiguous argument 'unfuddle/local/master^{commit}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
- environment:
jenkins 1.504, git 1.2
Contributor guide
Assessment
This issue has not been assessed yet.