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

Git plugin doesn't use refspec on the first clone/fetch

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: git-plugin
    • Labels:
      None
    • Environment:
      Jenkins ver. 1.649
      Git plugin 2.4.2
    • Similar Issues:

      Description

      Our repositories have lots of references and we only need to build from a single branch from each job. For example, I have a job with refspec +refs/heads/master:refs/remotes/origin/master.

      On the first clone, it does the following:

      Cloning the remote Git repository
      Using shallow clone
      Avoid fetching tags
      Cloning repository https://github.com/foo.git
      > git init /tmp/jenkins/slave1/workspace/sample/smoke-test # timeout=10
      Fetching upstream changes from https://github.com/foo.git
      > git --version # timeout=10
      > git -c core.askpass=true fetch --no-tags --progress https://github.com/foo.git +refs/heads/*:refs/remotes/origin/* --depth=1 # timeout=10

        Attachments

          Issue Links

            Activity

            ctran Cuong Tran created issue -
            ctran Cuong Tran made changes -
            Field Original Value New Value
            Description Our repositories have lots of references and we only need to build from a single branch from each job. For example, I have a job with refspec +refs/heads/master:refs/remotes/origin/master.

            On the first clone, it does the following:

            Cloning the remote Git repository
            Using shallow clone
            Avoid fetching tags
            Cloning repository https://github.com/foo.git
             > git init /tmp/jenkins/slave1/workspace/sample/smoke-test # timeout=10
            Fetching upstream changes from https://github.com/foo.git
             > git --version # timeout=10
             > git -c core.askpass=true fetch --no-tags --progress https://github.com/foo.git +refs/heads/*:refs/remotes/origin/* --depth=1 # timeout=10
            Our repositories have lots of references and we only need to build from a single branch from each job. For example, I have a job with refspec +refs/heads/master:refs/remotes/origin/master.

            On the first clone, it does the following:

            Cloning the remote Git repository
            Using shallow clone
            Avoid fetching tags
            Cloning repository https://github.com/foo.git
             > git init /tmp/jenkins/slave1/workspace/sample/smoke-test # timeout=10
            Fetching upstream changes from https://github.com/foo.git
             > git --version # timeout=10
             > git -c core.askpass=true fetch --no-tags --progress https://github.com/foo.git +refs/heads/**:refs/remotes/origin/** --depth=1 # timeout=10
            markewaite Mark Waite made changes -
            Assignee Mark Waite [ markewaite ]
            timocov Eugene Timokhov made changes -
            Status Open [ 1 ] Closed [ 6 ]
            Resolution Duplicate [ 3 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 169013 ] JNJira + In-Review [ 209746 ]
            javibm Javier Agüera made changes -
            Resolution Duplicate [ 3 ]
            Status Closed [ 6 ] Reopened [ 4 ]
            markewaite Mark Waite made changes -
            Link This issue is related to JENKINS-31393 [ JENKINS-31393 ]
            markewaite Mark Waite made changes -
            Status Reopened [ 4 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            markewaite Mark Waite made changes -
            Link This issue is related to JENKINS-36507 [ JENKINS-36507 ]
            dageissl Daniel Geißler made changes -
            Link This issue relates to JENKINS-28516 [ JENKINS-28516 ]
            markewaite Mark Waite made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

              People

              • Assignee:
                Unassigned
                Reporter:
                ctran Cuong Tran
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: