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

Pipeline shallow git clone takes longer than non-shallow clone

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • git-plugin
    • None

      I ran the following commands to compare difference in time taken : 

      1. Non-shallow clone using pipeline DSL: 
      checkout([$class: 'GitSCM', branches: [[name: branchName]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'LocalBranch', localBranch: branchName], [$class: 'CleanBeforeCheckout'], [$class: 'CloneOption', noTags: false, reference: '', shallow: false, timeout: 10]], submoduleCfg: [], userRemoteConfigs: [[url: 'git@github.corp.xxxx.com:'+orgName+'/'+repoName+'.git']]])
      2. Shallow clone using pipeline DSL : 
      checkout([$class: 'GitSCM', branches: [[name: branchName]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'LocalBranch', localBranch: branchName], [$class: 'CleanBeforeCheckout'], [$class: 'CloneOption', depth: 1, noTags: false, reference: '', shallow: true, timeout: 10]], submoduleCfg: [], userRemoteConfigs: [[url: 'git@github.corp.xxxx.com:'+orgName+'/'+repoName+'.git']]]) { note: I've also tried ^ shallow clone command without specifying 'depth: 1', but shows same behavior }
      3. Shallow clone using shell command : 
      sh "git clone --depth 1 git@github.xxx.com:Test/repoxyz.git -b master"

      RESULTS : 
      1. Non-shallow clone command : 1min 54s

      2. Shallow clone pipeline dsl command : 3min 31s

      3. Shallow clone using shell command : 15 secs

       

      ENVIRONMENT : 
      Jenkins : version 2.32.3
      git-plugin : Tested in both versions- 3.2.0 & 3.3.0

            Unassigned Unassigned
            raulkumar28 Rahul Racha
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: