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

Git plugin calls fetch twice per checkout

    XMLWordPrintable

    Details

    • Similar Issues:
    • Released As:
      git plugin 4.4.0

      Description

      When performing a git clone operation,

      git-client and git-plugin both triggers a git fetch.

       

      Below are the two lines of code running in the same git clone command both doing fetches.

       

      The second link is part of the GITSCM step, it triggers the git-client-plugin's CloneCommand (first link) to perform the clone operation. And afterwards, the GITSCM step performs a fetch once the CloneCommand Completes.

      However, within the CloneCommand (first link) itself, a fetch command was already done.

       

      https://github.com/jenkinsci/git-client-plugin/blob/4241e818dbe27fb78093094f29ebcd2203166610/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java#L609

       

      https://github.com/jenkinsci/git-plugin/blob/cb58c74efafafd08bc03bba2787997c6a0272df0/src/main/java/hudson/plugins/git/GitSCM.java#L1153

       

      I am aware there are needs to support for git clone to fetch all refs first -JENKINS-31393-. The suggestion provided in that ticket was to use "honor git refspec", so shouldn't "honor git refspec" skip the first fetch here?

       

      Thanks,

      Sam

        Attachments

          Issue Links

            Activity

            slcy sam leung created issue -
            slcy sam leung made changes -
            Field Original Value New Value
            Description When performing a git clone operation,

            git-client and git-plugin both triggers a git fetch.

             

            Below are the two lines of code running in the same git clone command both doing fetches.

            [https://github.com/jenkinsci/git-client-plugin/blob/4241e818dbe27fb78093094f29ebcd2203166610/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java#L609]

             

            [https://github.com/jenkinsci/git-plugin/blob/cb58c74efafafd08bc03bba2787997c6a0272df0/src/main/java/hudson/plugins/git/GitSCM.java#L1153]

             

            I am aware there are needs to support for git clone to fetch all refs first [JENKINS-31393|https://issues.jenkins-ci.org/browse/JENKINS-31393]. The suggestion provided was to use "honor git refspec", so shouldn't "honor git refspec" skip the first fetch here?

             

            Thanks,

            Sam
            When performing a git clone operation,

            git-client and git-plugin both triggers a git fetch.

             

            Below are the two lines of code running in the same git clone command both doing fetches.

            [https://github.com/jenkinsci/git-client-plugin/blob/4241e818dbe27fb78093094f29ebcd2203166610/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java#L609]

             

            [https://github.com/jenkinsci/git-plugin/blob/cb58c74efafafd08bc03bba2787997c6a0272df0/src/main/java/hudson/plugins/git/GitSCM.java#L1153]

             

            I am aware there are needs to support for git clone to fetch all refs first JENKINS-31393. The suggestion provided in that ticket was to use "honor git refspec", so shouldn't "honor git refspec" skip the first fetch here?

             

            Thanks,

            Sam
            markewaite Mark Waite made changes -
            Assignee Mark Waite [ markewaite ]
            slcy sam leung made changes -
            Description When performing a git clone operation,

            git-client and git-plugin both triggers a git fetch.

             

            Below are the two lines of code running in the same git clone command both doing fetches.

            [https://github.com/jenkinsci/git-client-plugin/blob/4241e818dbe27fb78093094f29ebcd2203166610/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java#L609]

             

            [https://github.com/jenkinsci/git-plugin/blob/cb58c74efafafd08bc03bba2787997c6a0272df0/src/main/java/hudson/plugins/git/GitSCM.java#L1153]

             

            I am aware there are needs to support for git clone to fetch all refs first JENKINS-31393. The suggestion provided in that ticket was to use "honor git refspec", so shouldn't "honor git refspec" skip the first fetch here?

             

            Thanks,

            Sam
            When performing a git clone operation,

            git-client and git-plugin both triggers a git fetch.

             

            Below are the two lines of code running in the same git clone command both doing fetches.

             

            The first link is part of the Git-client clone step, it triggers the git-plugin CloneCommand (second link) to perform the clone operations. And afterwards, the Git-client plugin performs a fetch once cloneCommand Completes.

            However, within the cloneCommand (second link) itself, a fetch command was already done.

             

            [https://github.com/jenkinsci/git-client-plugin/blob/4241e818dbe27fb78093094f29ebcd2203166610/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java#L609]

             

            [https://github.com/jenkinsci/git-plugin/blob/cb58c74efafafd08bc03bba2787997c6a0272df0/src/main/java/hudson/plugins/git/GitSCM.java#L1153]

             

            I am aware there are needs to support for git clone to fetch all refs first -JENKINS-31393-. The suggestion provided in that ticket was to use "honor git refspec", so shouldn't "honor git refspec" skip the first fetch here?

             

            Thanks,

            Sam
            slcy sam leung made changes -
            Description When performing a git clone operation,

            git-client and git-plugin both triggers a git fetch.

             

            Below are the two lines of code running in the same git clone command both doing fetches.

             

            The first link is part of the Git-client clone step, it triggers the git-plugin CloneCommand (second link) to perform the clone operations. And afterwards, the Git-client plugin performs a fetch once cloneCommand Completes.

            However, within the cloneCommand (second link) itself, a fetch command was already done.

             

            [https://github.com/jenkinsci/git-client-plugin/blob/4241e818dbe27fb78093094f29ebcd2203166610/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java#L609]

             

            [https://github.com/jenkinsci/git-plugin/blob/cb58c74efafafd08bc03bba2787997c6a0272df0/src/main/java/hudson/plugins/git/GitSCM.java#L1153]

             

            I am aware there are needs to support for git clone to fetch all refs first -JENKINS-31393-. The suggestion provided in that ticket was to use "honor git refspec", so shouldn't "honor git refspec" skip the first fetch here?

             

            Thanks,

            Sam
            When performing a git clone operation,

            git-client and git-plugin both triggers a git fetch.

             

            Below are the two lines of code running in the same git clone command both doing fetches.

             

            The second link is part of the GITSCM step, it triggers the git-client-plugin's CloneCommand (first link) to perform the clone operation. And afterwards, the GITSCM step performs a fetch once the CloneCommand Completes.

            However, within the CloneCommand (first link) itself, a fetch command was already done.

             

            [https://github.com/jenkinsci/git-client-plugin/blob/4241e818dbe27fb78093094f29ebcd2203166610/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java#L609]

             

            [https://github.com/jenkinsci/git-plugin/blob/cb58c74efafafd08bc03bba2787997c6a0272df0/src/main/java/hudson/plugins/git/GitSCM.java#L1153]

             

            I am aware there are needs to support for git clone to fetch all refs first --JENKINS-31393--. The suggestion provided in that ticket was to use "honor git refspec", so shouldn't "honor git refspec" skip the first fetch here?

             

            Thanks,

            Sam
            markewaite Mark Waite made changes -
            Priority Major [ 3 ] Minor [ 4 ]
            markewaite Mark Waite made changes -
            Summary Git clone triggers fetch twice Git clone calls fetch twice for a single job
            markewaite Mark Waite made changes -
            Summary Git clone calls fetch twice for a single job Git plugin calls fetch twice for a single job
            markewaite Mark Waite made changes -
            Link This issue is related to JENKINS-56404 [ JENKINS-56404 ]
            markewaite Mark Waite made changes -
            Summary Git plugin calls fetch twice for a single job Git plugin calls fetch twice per checkout
            markewaite Mark Waite made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Fixed but Unreleased [ 10203 ]
            markewaite Mark Waite made changes -
            Released As git plugin 4.4.0
            Status Fixed but Unreleased [ 10203 ] Closed [ 6 ]
            markewaite Mark Waite made changes -
            Remote Link This issue links to "PR 845 - remove redundant fetch (Web Link)" [ 25719 ]

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              slcy sam leung
              Votes:
              2 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: