jenkinsci / jenkinsci/git-plugin

[JENKINS-25049] Git plugin ignores Refspec when triggering build on commit nitification

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

Description

Default refspec according to the documentation is

+refs/heads/*:refs/remotes/REPOSITORYNAME/*

When I click on "Trigger build" in Stash's pull request overview, my job fails, because it cannot find commit in the specified refspecs (because commit is in pull requests, not in heads).

 > C:\Program Files (x86)\Git\bin\git.exe rev-parse "1c2ead96dfe52f7f0675161f025c2541ede93782^{commit}" # timeout=10

FATAL: Command "C:\Program Files (x86)\Git\bin\git.exe rev-parse "1c2ead96dfe52f7f0675161f025c2541ede93782^{commit}"" returned status code 128:
stdout: 1c2ead96dfe52f7f0675161f025c2541ede93782^{commit}

stderr: fatal: ambiguous argument '1c2ead96dfe52f7f0675161f025c2541ede93782^{commit}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'

hudson.plugins.git.GitException: Command "C:\Program Files (x86)\Git\bin\git.exe rev-parse "1c2ead96dfe52f7f0675161f025c2541ede93782^{commit}"" returned status code 128:
stdout: 1c2ead96dfe52f7f0675161f025c2541ede93782^{commit}

stderr: fatal: ambiguous argument '1c2ead96dfe52f7f0675161f025c2541ede93782^{commit}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'

---
Originally reported by pbaranchikov, imported from: Git plugin ignores Refspec when triggering build on commit nitification


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

Raw content of original issue

Default refspec according to the documentation is



+refs/heads/*:refs/remotes/REPOSITORYNAME/*


When I click on "Trigger build" in Stash's pull request overview, my job fails, because it cannot find commit in the specified refspecs (because commit is in pull requests, not in heads).



 > C:\Program Files (x86)\Git\bin\git.exe rev-parse "1c2ead96dfe52f7f0675161f025c2541ede93782^{commit}" # timeout=10

FATAL: Command "C:\Program Files (x86)\Git\bin\git.exe rev-parse "1c2ead96dfe52f7f0675161f025c2541ede93782^{commit}"" returned status code 128:
stdout: 1c2ead96dfe52f7f0675161f025c2541ede93782^{commit}

stderr: fatal: ambiguous argument '1c2ead96dfe52f7f0675161f025c2541ede93782^{commit}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

hudson.plugins.git.GitException: Command "C:\Program Files (x86)\Git\bin\git.exe rev-parse "1c2ead96dfe52f7f0675161f025c2541ede93782^{commit}"" returned status code 128:
stdout: 1c2ead96dfe52f7f0675161f025c2541ede93782^{commit}

stderr: fatal: ambiguous argument '1c2ead96dfe52f7f0675161f025c2541ede93782^{commit}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'


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.