• Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Major Major
    • git-plugin
    • None

      There is a need for a "More advanced clone behaviors"

      The current "Advanced clone behaviours" takes us just part of the way when needing to configure the clone operation.

      There are a lot of options on git clone that is not possible to set.
      Ref https://git-scm.com/docs/git-clone

      Example:
      We currently have the need to do a shallow clone, but need to include all branches. Meaning that we want to add the --no-single-branch option.
      We cannot see any other way of achieving this right now.

      I assume this request will solve JENKINS-61109 and similar issues as well.

          [JENKINS-61127] More freely defined advanced clone behaviours

          Mark Waite added a comment - - edited

          A shallow clone with all branches is the default when shallow clone is enabled. The default refspec pulls all branches.

          For historical reasons, the Jenkins git plugin uses a combination of git init and git fetch to populate its workspaces. I don't expect that to change in the future because it would be very likely to break many, many Jenkins users. If the git plugin were to use git clone directly, it would need to be through a completely new code path so that the existing behaviors would be retained.

          Mark Waite added a comment - - edited A shallow clone with all branches is the default when shallow clone is enabled. The default refspec pulls all branches. For historical reasons, the Jenkins git plugin uses a combination of git init and git fetch to populate its workspaces. I don't expect that to change in the future because it would be very likely to break many, many Jenkins users. If the git plugin were to use git clone directly, it would need to be through a completely new code path so that the existing behaviors would be retained.

          Mark Waite added a comment -

          Won't implement this in the git plugin because we prefer advanced clone options be set through a credentials binding as described in https://plugins.jenkins.io/git/#credential-binding

          Mark Waite added a comment - Won't implement this in the git plugin because we prefer advanced clone options be set through a credentials binding as described in https://plugins.jenkins.io/git/#credential-binding

            Unassigned Unassigned
            soltor0 Tor Christian Solevågseide
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: