git plugin should NOT tag every build by default

Details

Description

Git plugin automatically tries to add tags to my Git repository for every build (every 15 minutes or so!). that's very weird it does it automatically by default without me configuring this.
I don't need hundreds of tags in Git repo... I suggest turning this OFF by default and allowing to configure it in Jenkins UI per build job.

Alexey Java
added a comment - 06/Jan/12 9:56 AM marking as "blocker" because it's impossible to use this plugin with Jenkins unless you configure your build machine to tag all builds (which may be impossible or very undesirable for many projects)

Patrick Hemmer
added a comment - 03/Sep/14 4:03 PM I noticed after I submitted that comment that it doesn't happen unless the git-publisher is enabled (post-build action). As soon as it's enabled, it starts generating tags of the form "jenkins-$
{project}
-$
{build_number}
-SUCCESS"

Patrick Hemmer
added a comment - 03/Sep/14 4:07 PM Looks like it's from this: https://github.com/jenkinsci/git-plugin/blob/e384fbff87fec3473f7032760dfd0f4ec5285896/src/main/java/hudson/plugins/git/GitPublisher.java#L215
The code does have a conditional gitSCM.getSkipTag , but I have no clue what controls that.

1. I think if you previously used a version of the git plugin which DID enable tags on builds by default, then simply upgrading to the version where tags are disabled by default would not change that setting in your existing builds. You would need to manually do that.
2. In either case, I think the tags are only created in your local checkout of the repo. They would not be pushed to the remote repo unless you happened to do a 'git push' or 'git push --tags' as part of your build job, or used the git-publisher action as Patrick points out. In my case we create our own tags for builds, in certain cases, and push those. Each time we did that we would also end up with the superfluous Jenkins tags crapping up the remote repo. I think this is why not everyone saw this auto-tag behavior as such a big deal.

owenmehegan
added a comment - 03/Sep/14 6:43 PM 1. I think if you previously used a version of the git plugin which DID enable tags on builds by default, then simply upgrading to the version where tags are disabled by default would not change that setting in your existing builds. You would need to manually do that.
2. In either case, I think the tags are only created in your local checkout of the repo. They would not be pushed to the remote repo unless you happened to do a 'git push' or 'git push --tags' as part of your build job, or used the git-publisher action as Patrick points out. In my case we create our own tags for builds, in certain cases, and push those. Each time we did that we would also end up with the superfluous Jenkins tags crapping up the remote repo. I think this is why not everyone saw this auto-tag behavior as such a big deal.

Adding the Git Publisher step was the magic for me. Once that is added, then the jenkins-job_name-job_number-SUCCESS tag is written for each successful job.

As far as I can tell, Owen Mehegan is correct that the tags are entirely local to the repository, unless you specifically choose to push the tag. Can you further describe the cause of your concern for those extra tags in the repository?

Mark Waite
added a comment - 05/Sep/14 4:42 AM Adding the Git Publisher step was the magic for me. Once that is added, then the jenkins-job_name-job_number-SUCCESS tag is written for each successful job.
As far as I can tell, Owen Mehegan is correct that the tags are entirely local to the repository, unless you specifically choose to push the tag. Can you further describe the cause of your concern for those extra tags in the repository?

The problem this causes is with things that use the tags. A good example would be git describe --tags. A build job might use this command to generate a version for the build. However with the jenkins tags getting added in, this breaks as the command returns the wrong tag.

Patrick Hemmer
added a comment - 05/Sep/14 5:45 PM The problem this causes is with things that use the tags. A good example would be git describe --tags . A build job might use this command to generate a version for the build. However with the jenkins tags getting added in, this breaks as the command returns the wrong tag.
I've ended up just adding git tag d $(git tag --list 'jenkins *') to my build jobs. It's dirty, but it works.