jenkinsci / jenkinsci/git-plugin

[JENKINS-18132] Git plugin failed to evaluate the variable's value for local repo directory when using Git hook

Open
#2,288 0 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

Our project is using a variable to specify the local repository directory for Git, such as "${var}". When triggering builds with Git hook, GitSCM.compareRemoteRevisionWithImpl() uses it's plain text value to retrieve the working directory, eg "workspace/${var}" instead of "workspace/dir". As a result, hook always think new change is found and trigger new builds even there is no new change at all.

I did some debugging and found that the environment variables retrieved when triggered by hooks are less than those when triggered by "Build Now". But I could come up with a quick fix.

---
Originally reported by qzhjason, imported from: Git plugin failed to evaluate the variable's value for local repo directory when using Git hook


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

Raw content of original issue

Our project is using a variable to specify the local repository directory for Git, such as "${var}". When triggering builds with Git hook, GitSCM.compareRemoteRevisionWithImpl() uses it's plain text value to retrieve the working directory, eg "workspace/${var}" instead of "workspace/dir". As a result, hook always think new change is found and trigger new builds even there is no new change at all.

I did some debugging and found that the environment variables retrieved when triggered by hooks are less than those when triggered by "Build Now". But I could come up with a quick fix.

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.