git-plugin icon indicating copy to clipboard operation
git-plugin copied to clipboard

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

Open jenkins-infra-bot opened this issue 6 years ago • 3 comments

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


Originally reported by rthurner, imported from: fetch has 3 options: nothing, --no-tags, --tags, jenkins only 2
  • status: Open
  • priority: Major
  • component(s): git-plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 4
  • imported: 2025-12-02
Raw content of original issue

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-infra-bot avatar Mar 12 '19 04:03 jenkins-infra-bot

rthurner:
  • Original comment link
  • Raw content of original comment:

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

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

jenkins-infra-bot avatar Mar 13 '19 03:03 jenkins-infra-bot

rthurner:

duplicate of JENKINS-45164

jenkins-infra-bot avatar Apr 09 '19 16:04 jenkins-infra-bot

sgka:
  • Original comment link
  • Raw content of original comment:

    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.

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.

jenkins-infra-bot avatar Apr 01 '23 22:04 jenkins-infra-bot