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

Add ability to specify shallow clone depth

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The git plugin has the capability to perform a "shallow clone" under Advanced clone behaviours, but in some specific instances, being able to clone to a greater depth than one can prove helpful but without having to get an entire repo (ours is getting rather large).

      In our case we poll every five minutes and since we have a good sized development team we find that occasionally multiple commits get pushed during the window and then Jenkins reference hash won't show up in the shallow clone log output so we don't get a changelog generated and the committer doesn't get a result email either.

      If you could add the ability to specify a depth value for cloning that would be very helpful!

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment - - edited

          Included in git client plugin 1.19.0

          Show
          markewaite Mark Waite added a comment - - edited Included in git client plugin 1.19.0
          Hide
          henriquer Henrique Rodrigues added a comment -

          Thank you Mark Waite, but how can I specify the depth in the UI?

          Show
          henriquer Henrique Rodrigues added a comment - Thank you Mark Waite , but how can I specify the depth in the UI?
          Hide
          markewaite Mark Waite added a comment -

          Henrique Rodrigues the addition to the git client plugin is the first step to eventually show a field in the user interface which specifies shallow clone depth. The user interface portion is in the git plugin rather than the git client plugin, and is not yet implemented.

          Show
          markewaite Mark Waite added a comment - Henrique Rodrigues the addition to the git client plugin is the first step to eventually show a field in the user interface which specifies shallow clone depth. The user interface portion is in the git plugin rather than the git client plugin, and is not yet implemented.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Nicholas Jasieniecki
          Path:
          src/main/java/hudson/plugins/git/extensions/impl/CloneOption.java
          src/main/resources/hudson/plugins/git/extensions/impl/CloneOption/config.groovy
          src/main/resources/hudson/plugins/git/extensions/impl/CloneOption/help-depth.html
          http://jenkins-ci.org/commit/git-plugin/d96318dcb142d378d31678cfcb0a40841760b5b4
          Log:
          JENKINS-24728 Added UI Elements for shallow clone depth

          Use @DataBoundSetter instead of extending the constructor as was done
          in the original pull request. The DataBoundSetter annotation simplifies
          the change.

          Original concept by Nicholas Jasieniecki, with changes by Mark Waite.

          Add help to shallow clone depth setting.

          Add shallow and shallow depth to fetch command options. The previous
          implementation only set depth on the clone arguments, not on the fetch
          arguments. Without the depth on the fetch arguments, fetch retrieves
          history additively, rather than retaining the depth at the originally
          specified value. That caused the history in a repository which is being
          reused to grow each time new commits are detected and built by the job.
          This change now keeps the history at the specified depth even with
          incremental updates of the repository by new commits.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicholas Jasieniecki Path: src/main/java/hudson/plugins/git/extensions/impl/CloneOption.java src/main/resources/hudson/plugins/git/extensions/impl/CloneOption/config.groovy src/main/resources/hudson/plugins/git/extensions/impl/CloneOption/help-depth.html http://jenkins-ci.org/commit/git-plugin/d96318dcb142d378d31678cfcb0a40841760b5b4 Log: JENKINS-24728 Added UI Elements for shallow clone depth Use @DataBoundSetter instead of extending the constructor as was done in the original pull request. The DataBoundSetter annotation simplifies the change. Original concept by Nicholas Jasieniecki, with changes by Mark Waite. Add help to shallow clone depth setting. Add shallow and shallow depth to fetch command options. The previous implementation only set depth on the clone arguments, not on the fetch arguments. Without the depth on the fetch arguments, fetch retrieves history additively, rather than retaining the depth at the originally specified value. That caused the history in a repository which is being reused to grow each time new commits are detected and built by the job. This change now keeps the history at the specified depth even with incremental updates of the repository by new commits.
          Hide
          markewaite Mark Waite added a comment -

          Included in git plugin 2.4.3, released 19 Mar 2016.

          Show
          markewaite Mark Waite added a comment - Included in git plugin 2.4.3, released 19 Mar 2016.

            People

            • Assignee:
              Unassigned
              Reporter:
              srrobinson Sean Robinson
            • Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: