Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-71506

Support custom refspec in lightweight checkout


    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-plugin
    • None

      I want to enable the lightweight checkout for jobs which verify a Gerrit change. A change in Gerrit is accessed by the refspec refs/changes/id/change/patchset on the remote, e.g. refs/changes/21/12345/11. The SCM configuration uses this refspec in combination with the branch specifier "FETCH_HEAD". Unfortunatley the lightweight checkout is not supported for this configuration. Instead the entire source tree is checked-out on the controller to retrieve the pipeline file. It seems that currently only a branch or a tag are supported.

      Furthermore I have the additional requirement to checkout a specific revision instead of the branch head. Here we use the refspec to fetch a given branch and use a commit hash as the branch specifier.

      So it would desirable to enhance the lightweight checkout to fetch a given refspec and then read the pipeline file from the branch specifier. The current behavior is used if no refspec is given.

      Both can be achieved by tweaking the GitSCMFileSystem implementation. I will provide a PR for this issue.

            markewaite Mark Waite
            ckullabosch Christoph Kulla
            0 Vote for this issue
            3 Start watching this issue