jenkinsci / jenkinsci/git-plugin
[JENKINS-41321] Add option for different refspec for polling and clone during build
- Dominant language
- Java
- Stars
- 694
- Forks
- 1.1k
- Avg merge
- 1h 29m
- Merged PRs (30d)
- 3
Description
To speed up the build I want to use a refspec to only clone the needed branch like this:
refs/heads/$GIT_LOCAL_BRANCH:refs/remotes/$GIT_BRANCH
This seemed to work great at first, but then I found out this refspec is also used during polling.
This means that not all branches are being built anymore, even though our branch specifier is '**', because they are simply not fetched anymore.
This is why I would like to have an option to specify a different refspec for the build than for the polling. So I can have these refspecs:
polling: refs/heads/*:refs/remotes/*
building: refs/heads/$GIT_LOCAL_BRANCH:refs/remotes/$GIT_BRANCH
---
Originally reported by jeltef, imported from: Add option for different refspec for polling and clone during build
Raw content of original issue
To speed up the build I want to use a refspec to only clone the needed branch like this:
refs/heads/$GIT_LOCAL_BRANCH:refs/remotes/$GIT_BRANCHThis seemed to work great at first, but then I found out this refspec is also used during polling.
This means that not all branches are being built anymore, even though our branch specifier is '**', because they are simply not fetched anymore.This is why I would like to have an option to specify a different refspec for the build than for the polling. So I can have these refspecs:
polling: refs/heads/*:refs/remotes/*
building: refs/heads/$GIT_LOCAL_BRANCH:refs/remotes/$GIT_BRANCH
Contributor guide
Assessment
This issue has not been assessed yet.