jenkinsci / jenkinsci/git-plugin

[JENKINS-23299] Project building from tag builds at each polling interval

Open
#2,483 14 comments 0 reactions 0 assignees View on GitHub
component:git-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

I have a job I changed to build from a tag. However, I'd left the polling enabled. I noticed that the job built every time that it polled. The polling log shows:


Started on Jun 3, 2014 7:20:00 PM

Using strategy: Default

[poll] Last Built Revision: Revision aacfd8d1828633ccfb7ced255e795a29e31d6228 (mytag)

> git ls-remote -h git@​hostname:my/project mytag

Done. Took 0.39 sec

Changes found

I noticed that the ls-remote command is being passed "-h", which I believe is causing the issue. The -h would exclude tags. Thus:


$ git ls-remote -h git@​hostname:my/project mytag

Yields no results, but removing the "-h":


$ git ls-remote git@​hostname:my/project mytag

aacfd8d1828633ccfb7ced255e795a29e31d6228 refs/tags/mytag

---
Originally reported by drwille, imported from: Project building from tag builds at each polling interval


  • status: Open
  • priority: Minor
  • component(s): git-plugin
  • label(s): polling, tag
  • resolution: Unresolved
  • votes: 0
  • watchers: 7
  • imported: 2025-12-02

Raw content of original issue

I have a job I changed to build from a tag. However, I'd left the polling enabled. I noticed that the job built every time that it polled. The polling log shows:


Started on Jun 3, 2014 7:20:00 PM
Using strategy: Default
[poll] Last Built Revision: Revision aacfd8d1828633ccfb7ced255e795a29e31d6228 (mytag)
> git ls-remote -h git@hostname:my/project mytag
Done. Took 0.39 sec
Changes found

I noticed that the ls-remote command is being passed "-h", which I believe is causing the issue. The -h would exclude tags. Thus:


$ git ls-remote -h git@hostname:my/project mytag

Yields no results, but removing the "-h":


$ git ls-remote git@hostname:my/project mytag
aacfd8d1828633ccfb7ced255e795a29e31d6228 refs/tags/mytag

environment

```
Jenkins 1.565

Git Client Plugin 1.8.1

Git Plugin 2.2.1
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.