jenkinsci / jenkinsci/git-plugin

[JENKINS-45900] GIT_PREVIOUS_(SUCCESSFUL_)?COMMIT is not set when the it's tag that is checkouted

Open
#3,164 2 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

GIT_PREVIOUS_COMMIT and GIT_PREVIOUS_SUCCESSFUL_COMMIT are set correctly when a branch is checkouted but not when a tag.

This should probably work even if we are checking out just a random commit that is currently not pointed at by any branch or tagged with any tag.

 

---
Originally reported by mstoykov, imported from: GIT_PREVIOUS_(SUCCESSFUL_)?COMMIT is not set when the it's tag that is checkouted


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

Raw content of original issue

GIT_PREVIOUS_COMMIT and GIT_PREVIOUS_SUCCESSFUL_COMMIT are set correctly when a branch is checkouted but not when a tag.

This should probably work even if we are checking out just a random commit that is currently not pointed at by any branch or tagged with any tag.

 

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.