jenkinsci / jenkinsci/git-plugin

[JENKINS-38362] Poll on a full clone on master, shallow clone using refspec on slaves

Open
#2,951 2 comments 0 reactions 0 assignees View on GitHub
component:git-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

We have a large git repo with lots of history and lots of branches. As of JENKINS-31393, we can now specify a refspec and have the initial fetch respect it.

We have two jobs for each repo. One that builds master, and one that builds everything except master. Specifying a refspec works for our master job, but won't for the feature branches job since it needs to be able to fetch more than just the specified refspec.

However, a shallow clone of all branches is too expensive and takes about 18 minutes to complete from inside the datacenter that contains our git repo.

It seems like the ideal is for the master to have a full clone of our repo to be able to do polling and figure out what branch / revision to build, and then for it to tell a slave what revision to do a shallow checkout using a full refspec so it only checks out that one branch.

---
Originally reported by eliwhite, imported from: Poll on a full clone on master, shallow clone using refspec on slaves


  • status: Open
  • priority: Minor
  • component(s): git-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 3
  • imported: 2025-12-02

Raw content of original issue

We have a large git repo with lots of history and lots of branches. As of JENKINS-31393, we can now specify a refspec and have the initial fetch respect it.

We have two jobs for each repo. One that builds master, and one that builds everything except master. Specifying a refspec works for our master job, but won't for the feature branches job since it needs to be able to fetch more than just the specified refspec.

However, a shallow clone of all branches is too expensive and takes about 18 minutes to complete from inside the datacenter that contains our git repo.

It seems like the ideal is for the master to have a full clone of our repo to be able to do polling and figure out what branch / revision to build, and then for it to tell a slave what revision to do a shallow checkout using a full refspec so it only checks out that one branch.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.