简体   繁体   中英

How to download one specific gerrit change set in jenkins git plugin?

Normally we use gerrit trigger plugin in jenkins to download the gerrit changeset.

But in some case, we want to download the specific changesets directly.

For example openstack Change #503032

git pull git://git.openstack.org/openstack/tripleo-quickstart-extras refs/changes/32/503032/2

And set the Refspec to refs/changes/32/503032/2 in git repo like

在此处输入图片说明

And enable the Honor refspec on initial clone in Additional behaviours like

在此处输入图片说明

But I got error in console log

Fetching upstream changes from git://git.openstack.org/openstack/tripleo-quickstart-extras
 > git fetch --tags --progress git://git.openstack.org/openstack/tripleo-quickstart-extras refs/changes/32/503032/2 --depth=1
 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
 > git rev-parse origin/master^{commit} # timeout=10
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.

Any suggestion, we don't want to use the extra command in shell build step.

Set "Branch" to FETCH_HEAD and the specified refspec will be checked out.

FETCH_HEAD is a temporary ref pointing to the latest fetched refspec, eg. branch, commit. See this question for more information: What does FETCH_HEAD in Git mean? .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM