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

git - optional control to disable fetching tags?

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Won't Fix
    • Component/s: git-plugin
    • Labels:
      None
    • Environment:
      windows xp w/ sp2 (master and slave), hudson 1.352, git 0.8
    • Similar Issues:

      Description

      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?

        Attachments

          Activity

          Hide
          dt25954 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?

          Show
          dt25954 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?
          Hide
          dt25954 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.

          Show
          dt25954 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.
          Hide
          algorhythm99 Jason Wooster added a comment -

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

          Show
          algorhythm99 Jason Wooster added a comment - Pull request to simply remove the -t option from the fetch: https://github.com/jenkinsci/git-plugin/pull/77
          Hide
          ndeloof 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 ?

          Show
          ndeloof 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 ?
          Hide
          dt25954 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?

          Show
          dt25954 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?
          Hide
          ndeloof Nicolas De Loof added a comment -

          fetching tags don't have significant performance impacts

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

            People

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

              Dates

              • Created:
                Updated:
                Resolved: