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

git - optional control to disable fetching tags?

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Major Major
    • git-plugin
    • None
    • windows xp w/ sp2 (master and slave), hudson 1.352, git 0.8

      When fetching the revision from the upstream repo, the git plugin uses the -t parameter to the fetch command, which instructs the fetch to pull all the tags present. Would it be possible to have an optional parameter to suppress the -t flag on the fetch?

          [JENKINS-6124] git - optional control to disable fetching tags?

          The -t option should just be removed.

          What is the use case for needing to download all tags from every repository?

          Douglas Beatty added a comment - The -t option should just be removed. What is the use case for needing to download all tags from every repository?

          I would also like to add that this also makes the help text associated with the refspec in the job configuration false.

          Specifically,

          "When do you want to modify this value? A good example is when you want to just retrieve one branch. For example, +refs/heads/master:refs/remotes/origin/master would only retrieve the master branch and nothing else."

          This is not true. It would retrieve the master branch and every tag (and their associated objects) in the entire repository.

          Douglas Beatty added a comment - I would also like to add that this also makes the help text associated with the refspec in the job configuration false. Specifically, "When do you want to modify this value? A good example is when you want to just retrieve one branch. For example, +refs/heads/master:refs/remotes/origin/master would only retrieve the master branch and nothing else." This is not true. It would retrieve the master branch and every tag (and their associated objects) in the entire repository.

          Jason Wooster added a comment -

          Pull request to simply remove the -t option from the fetch:
          https://github.com/jenkinsci/git-plugin/pull/77

          Jason Wooster added a comment - Pull request to simply remove the -t option from the fetch: https://github.com/jenkinsci/git-plugin/pull/77

          the use case is that the git-plugin can be used to build a tag as specified as job parameter.
          This is used to build releases binaries from jenkins for example
          ignoring this could be an option to set in advanced section, not just removed as you suggested

          I just wonder why you don't want tags to be fetched. Does this imply a significant performance change for you to clone the repository ?

          Nicolas De Loof added a comment - the use case is that the git-plugin can be used to build a tag as specified as job parameter. This is used to build releases binaries from jenkins for example ignoring this could be an option to set in advanced section, not just removed as you suggested I just wonder why you don't want tags to be fetched. Does this imply a significant performance change for you to clone the repository ?

          Douglas Beatty added a comment - - edited

          For a standard source code repository, this is not significant performance wise and we have not noticed this issue on our source code repositories.

          However, in general, it is not good that it is fetching references and therefore objects that are not required by the build. It is just inefficient. However, as stated, for source code repositories it is not significant enough that we have noticed.

          I have created a new issue that targets the scenario for our specific issue JENKINS-14572.

          Where we have noticed it is in the Git repositories we are using to deploy our web applications which are large repositories of binary files.

          We create each deployment image as an orphan commit, tag it, and push the tag not the branch back to our Git server. This way we can delete the tags after a holding period causing those commits to be unreferenced and eligible for garbage collection.

          We have the Jenkins plug-in configured to pull down an 'empty' branch by specifying a refspec. When all of the tags are fetched, then a large number of unneeded objects are pulled down from the repository greatly increasing the size of the repositories on the Jenkins slaves.

          Having said all of that, if you want to build a specific tag, why not specify it in the refspec? The refspec can use build parameters also. Why fetch all tags when you only need one?

          Douglas Beatty added a comment - - edited For a standard source code repository, this is not significant performance wise and we have not noticed this issue on our source code repositories. However, in general, it is not good that it is fetching references and therefore objects that are not required by the build. It is just inefficient. However, as stated, for source code repositories it is not significant enough that we have noticed. I have created a new issue that targets the scenario for our specific issue JENKINS-14572 . Where we have noticed it is in the Git repositories we are using to deploy our web applications which are large repositories of binary files. We create each deployment image as an orphan commit, tag it, and push the tag not the branch back to our Git server. This way we can delete the tags after a holding period causing those commits to be unreferenced and eligible for garbage collection. We have the Jenkins plug-in configured to pull down an 'empty' branch by specifying a refspec. When all of the tags are fetched, then a large number of unneeded objects are pulled down from the repository greatly increasing the size of the repositories on the Jenkins slaves. Having said all of that, if you want to build a specific tag, why not specify it in the refspec? The refspec can use build parameters also. Why fetch all tags when you only need one?

          fetching tags don't have significant performance impacts

          Nicolas De Loof added a comment - fetching tags don't have significant performance impacts

            ndeloof Nicolas De Loof
            aaron_neerenberg aaron_neerenberg
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: