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

GIT_PREVIOUS_(SUCCESSFUL_)?COMMIT is not set when the it's tag that is checkouted

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-plugin
    • None

      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.

       

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

          Morgan Christiansson added a comment - - edited

          This seems to still be an issue. I am unable to get changelogs working when deploying tags because I can find no way to get commit of previous build.

          It's most likely this line in the code: https://github.com/jenkinsci/git-plugin/blob/942de7ac00272c0bbad625a811a17e66713014b8/src/main/java/hudson/plugins/git/GitSCM.java#L1346

          Also affecting build changelogs as reported in JENKINS-11108

          Morgan Christiansson added a comment - - edited This seems to still be an issue. I am unable to get changelogs working when deploying tags because I can find no way to get commit of previous build. It's most likely this line in the code: https://github.com/jenkinsci/git-plugin/blob/942de7ac00272c0bbad625a811a17e66713014b8/src/main/java/hudson/plugins/git/GitSCM.java#L1346 Also affecting build changelogs as reported in JENKINS-11108

            Unassigned Unassigned
            mstoykov mihail stoykov
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: