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

refspec is not applied on clone (initial fetch)

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: git-plugin
    • Labels:
    • Environment:
      Jenkins Latest and greatest (1.614) / Older but stable (1.596.3)
      git-client 1.17.1 / 1.16.1
      git-plugin 2.3.5 / 2.3.4
    • Similar Issues:

      Description

      As far as i can see the refspec is not used on the initial clone.
      Here is the relevant extract from a build with a cleaned workspace:

      Cloning the remote Git repository
      Cloning repository gitserver:/data/git/MyProject.git
       > /usr/bin/git init /data/jenkins/workspace/myjob.checkoutrefspec # timeout=10
      Fetching upstream changes from gitserver:/data/git/MyProject.git
       > /usr/bin/git --version # timeout=10
      using GIT_SSH to set credentials Jenkins private key
       > /usr/bin/git fetch --tags --progress gitserver:/data/git/MyProject.git +refs/heads/*:refs/remotes/origin/*
       > /usr/bin/git config remote.origin.url gitserver:/data/git/MyProject.git # timeout=10
       > /usr/bin/git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
       > /usr/bin/git config remote.origin.url gitserver:/data/git/MyProject.git # timeout=10
      

      this is directly followed by

      Fetching upstream changes from gitserver:/data/git/MyProject.git
      using GIT_SSH to set credentials Jenkins private key
       > /usr/bin/git fetch --tags --progress gitserver:/data/git/MyProject.git +refs/heads/development:refs/remotes/origin/development
       > /usr/bin/git rev-parse origin/development^{commit} # timeout=10
      Checking out Revision c5280c05a01a61f2ae43e46a1ee398be27cdc14e (origin/development)
       > /usr/bin/git config core.sparsecheckout # timeout=10
       > /usr/bin/git checkout -f c5280c05a01a61f2ae43e46a1ee398be27cdc14e
      First time build. Skipping changelog.
      

      wich is using the configured refspec. This fetch is used correctly in later builds.

      We have some old and heavy branches (with some binaries) that we do not want to get fetched at any time. As of today this is only possible with sparse checkouts, but they have the drawback that we can not push tags back to remote after the build.

        Attachments

          Issue Links

            Activity

            dageissl Daniel Geißler created issue -
            dageissl Daniel Geißler made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-26417 [ JENKINS-26417 ]
            markewaite Mark Waite made changes -
            Summary refsec is not applied on clone (initial fetch) refspec is not applied on clone (initial fetch)
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 163357 ] JNJira + In-Review [ 181196 ]
            dageissl Daniel Geißler made changes -
            Assignee Nicolas De Loof [ ndeloof ] Mark Waite [ markewaite ]
            dageissl Daniel Geißler made changes -
            Assignee Mark Waite [ markewaite ]
            dageissl Daniel Geißler made changes -
            Link This issue relates to JENKINS-31393 [ JENKINS-31393 ]
            dageissl Daniel Geißler made changes -
            Link This issue relates to JENKINS-33140 [ JENKINS-33140 ]
            dageissl Daniel Geißler made changes -
            Status Open [ 1 ] Closed [ 6 ]
            Resolution Fixed [ 1 ]

              People

              • Assignee:
                Unassigned
                Reporter:
                dageissl Daniel Geißler
              • Votes:
                5 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: