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

fetch has 3 options: nothing, --no-tags, --tags, jenkins only 2

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • git-plugin
    • None

      git fetch has three options to fetch tags:

      • "git fetch" fetches a branch with tags reachable, the ideal default
      • "git fetch --no-tags" fetches a branch without tags
      • "git fetch --tags" fetches tags not reachable from the branch, i.e. other branches also

      in jenkins variant 1, fetching tags reachable cannot be configured any more (with ease), while it reasonably should be the default? also the branch name is not there in the git repo fetched. all of these operatins add labels to existing commits so do not increase the clone size.

      this should be for multibranch pipeline, not sure what the correct component is.

      the current workaround is:

      // code placeholder
      
      

          [JENKINS-56517] fetch has 3 options: nothing, --no-tags, --tags, jenkins only 2

          remove blocker - does not help somebody looking at it ... 

          rupert je thurner added a comment - remove blocker - does not help somebody looking at it ... 

          duplicate of JENKINS-45164

          rupert je thurner added a comment - duplicate of  JENKINS-45164

          Sg Ka added a comment - - edited

          Came across this issue as well. For an old repo with a lot of tags, I don't want to pull all of them. But I still want some of the tags, essentially any tags that are tied to commits in the shallow clone depth. The first option is most desirable in this case.

          A poor workaround is to specify a refspec to pull some of the tags, like +refs/tags/2023*:refs/remotes/%{remote}/2023*. Due to the limitations of refspec, there doesn't seem to be a better way to fetch recent tags, and this would stop working after 2024 obviously.

          Sg Ka added a comment - - edited Came across this issue as well. For an old repo with a lot of tags, I don't want to pull all of them. But I still want some of the tags, essentially any tags that are tied to commits in the shallow clone depth. The first option is most desirable in this case. A poor workaround is to specify a refspec to pull some of the tags, like +refs/tags/2023*:refs/remotes/%{remote}/2023*. Due to the limitations of refspec, there doesn't seem to be a better way to fetch recent tags, and this would stop working after 2024 obviously.

            Unassigned Unassigned
            rthurner rupert je thurner
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: