jenkinsci / jenkinsci/git-plugin

[JENKINS-47350] "git rev-parse" fails on Linux v2.6.11 tag

Open
#3,200 1 comment 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

Version 3.3 of the git plugin added a step that runs "git rev-parse" on all tags (see also https://issues.jenkins-ci.org/browse/JENKINS-45447 ).

This change breaks building the Linux kernel. The reason is interesting: the v2.6.11  tag ( https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tag/?h=v2.6.11 ) does not have a backing commit: 

> git rev-parse refs/tags/v2.6.11^{commit} # timeout=10

FATAL: Command "git rev-parse refs/tags/v2.6.11^{commit}" returned status code 128:
stdout: refs/tags/v2.6.11^{commit}
stderr: error: refs/tags/v2.6.11^{commit}: expected commit type, but the object dereferences to tree type
error: refs/tags/v2.6.11^{commit}: expected commit type, but the object dereferences to tree type
fatal: ambiguous argument 'refs/tags/v2.6.11^{commit}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'

This tag is strange special case (which also noted in the tag's commit message). However, the Linux kernel is a very widely used project and building it using Jenkins should work. 

---
Originally reported by jakob_tsd, imported from: "git rev-parse" fails on Linux v2.6.11 tag


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

Raw content of original issue

Version 3.3 of the git plugin added a step that runs "git rev-parse" on all tags (see also https://issues.jenkins-ci.org/browse/JENKINS-45447 ).

This change breaks building the Linux kernel. The reason is interesting: the v2.6.11  tag ( https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tag/?h=v2.6.11 ) does not have a backing commit: 



> git rev-parse refs/tags/v2.6.11^{commit} # timeout=10

FATAL: Command "git rev-parse refs/tags/v2.6.11^{commit}" returned status code 128:
stdout: refs/tags/v2.6.11^{commit}
stderr: error: refs/tags/v2.6.11^{commit}: expected commit type, but the object dereferences to tree type
error: refs/tags/v2.6.11^{commit}: expected commit type, but the object dereferences to tree type
fatal: ambiguous argument 'refs/tags/v2.6.11^{commit}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'


This tag is strange special case (which also noted in the tag's commit message). However, the Linux kernel is a very widely used project and building it using Jenkins should work. 

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.