jenkinsci / jenkinsci/git-plugin

[JENKINS-33124] git ls-remote could be more optimal when we select a specific branch

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

Description

We are using git polling with a specific branch, for example we configure git://git.foo.nl/atcd.git as repository URL and refs/heads/master as branch to build. For the polling we see that the following command is used:

git -c core.askpass=true ls-remote -h git://git.foo.nl/atcd.git

Which returns all heads, it would be more optimal when the following is used, that only returns 1 branch

git -c core.askpass=true ls-remote -h git://git.foo.nl/atcd.git refs/heads/master

---
Originally reported by jwillemsen, imported from: git ls-remote could be more optimal when we select a specific branch


  • status: Open
  • priority: Minor
  • component(s): git-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-02

Raw content of original issue

We are using git polling with a specific branch, for example we configure git://git.foo.nl/atcd.git as repository URL and refs/heads/master as branch to build. For the polling we see that the following command is used:
git -c core.askpass=true ls-remote -h git://git.foo.nl/atcd.git

Which returns all heads, it would be more optimal when the following is used, that only returns 1 branch
git -c core.askpass=true ls-remote -h git://git.foo.nl/atcd.git refs/heads/master

  • environment: Linux

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.