Uploaded image for project: 'Bitbucket Server'
  1. Bitbucket Server
  2. BSERV-11499

Jira referencing to removed commit after amending a commit

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Medium
    • Resolution: Fixed
    • Component/s: None
    • Labels:

      Description

      Summary

      Jira referencing to amended commit from the pull request. This was due to changes in the commit message to point from one Jira issue key to another. However, after making the changes, the old issue key's Development panel is showing the links to the branch and pull request in the remote repository.

      Step to Reproduce

      1. Make first commit in the master branch. Then create a new branch called feature/development.
      2. Make the second commit on branch feature/development. Specify Jira's issue key(eg: SSPJ-101) in the commit message and push to the remote repository.
      3. Create a pull request from branch feature/development to master.
      4. In Jira, go to SSPJ-101 issue key and verify the Development panel information as it should link to branch feature/development, commit hash of the second commit and pull request.
      5. Make changes in the second commit using the command "git commit --amend" to point a different Jira issue key(eg: SSPJ-202) and force push to the remote repository.
      6. On Bitbucket Server, this will update the commit hash while the old commit hash and its message is marked as removed. The pull request is showing the correct information.
      7. In Jira in the SSPJ-202 issue key the Development panel is showing the link to branch feature/development, (new/updated)commit hash of the second commit and pull request.
      8. However, on SSPJ-101 issue key the development panel is still showing the link to branch feature/development and pull request while the commit is absent.

      Expected Results

      The Jira's SSPJ-101 issue key no longer links branch and pull request of the old commit message reference.

      Actual Results

      The Jira's SSPJ-101 issue key the development panel is still showing the link to branch feature/development and pull request while the commit is absent.

      Workaround

      Delete the pull request prior to step 5, make changes in the second commit using the command "git commit --amend" to point a different Jira issue key. Push the commit without the force/-f flag to the remote repository. Create a new pull request for the affected branches in the same manner.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              spetrucev stef
              Reporter:
              bannamalai Baskar Annamalai
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: