Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-25465

${GIT_BRANCH} macro expands full branch name + remotes instead of short name

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • git-plugin
    • None
    • Centos OS 6,
      git version 1.7.12.4,
      Jenkins ver. 1.588,
      GIT plugin 2.2.7

      Docs says that ${GIT_BRANCH} macro should expands to the full branch name, such as 'origin/master'. Otherwise(without fullName parameter), it only expands to the short name, such as 'master', but without fullName parameter it expands to 'remotes/origin/master' with fullName parameter it doesn't work at all.

          [JENKINS-25465] ${GIT_BRANCH} macro expands full branch name + remotes instead of short name

          Maciej Matys created issue -
          Horst Krause made changes -
          Link New: This issue is related to JENKINS-20446 [ JENKINS-20446 ]
          Matt Evans made changes -
          Attachment New: Parameters.PNG [ 31297 ]
          Matt Evans made changes -
          Comment [ I attached screen shot of current help content (version 1.5.1). I do not think this is clear and should be modified

          For instance I have a branch develop/test which I want to set as build name.

          However, by default if I use only ${GIT_REVISION} I get origin/develop/test set as branch name. According to help content if fullName is NOT set then it does NOT expand to full name and so I expect develop/test.

          To fix this I added ${GIT_BRANCH,fullName=false}. Help content should be updated to indicate default behavior includes origin and you must set fullName to false to strip origin.

          ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 159433 ] New: JNJira + In-Review [ 179979 ]
          Nicolas De Loof made changes -
          Assignee Original: Nicolas De Loof [ ndeloof ]

            Unassigned Unassigned
            metyl Maciej Matys
            Votes:
            8 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: