jenkinsci / jenkinsci/git-plugin

[JENKINS-21421] GIT_BRANCH_SHORT for branch name without release/, feature/, etc. Just the bit after the '/'

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

For cases where a filename expansion is needed for the git branch name, thre cannot be a '/' in a filename, so that part of the branch needs to be dropped.

ie:

GIT_BRANCH=release/blue-fish

then:

GIT_BRANCH_SHORT=blue-fish

Seems like a simple thing to do in the plugin, but not possible to do in a job.

---
Originally reported by bedge, imported from: GIT_BRANCH_SHORT for branch name without release/, feature/, etc. Just the bit after the '/'


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

Raw content of original issue

For cases where a filename expansion is needed for the git branch name, thre cannot be a '/' in a filename, so that part of the branch needs to be dropped.
ie:
GIT_BRANCH=release/blue-fish
then:
GIT_BRANCH_SHORT=blue-fish

Seems like a simple thing to do in the plugin, but not possible to do in a job.

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.