Search code examples
bitbucketpull-requestbitbucket-cloud

How can I restore a work-in-progress PR in Bitbucket Cloud?


I spent a lot of time describing my changes in a PR in Atlassian Bitbucket online, but my PC blue-screened before I could create the PR. Is there any way I can recover the description? If not through Bitbucket, perhaps through Google Chrome?

I tried looking in the repo's list of existing (created) PRs. I also tried creating a new PR from scratch with the same settings, hoping the description that I'd spent so much time on would automatically populate (Atlassian does that sometimes), but no luck.


Solution

  • Sadly, the answer is probably not.

    One major downside of BitBucket's Pull Request feature (compared to competitors like GitHub) is that it lacks a Draft PR capability to explicitly mark a PR as not yet ready for review. The description information in the Create PR interface for BitBucket Cloud only exists in your browser until you click "Create Pull Request" for the first time. You CAN continue to edit the description after creating the PR, but some developers prefer not to "edit in public".

    As an added complication you might not yet have seen, even without a browser crash you can get into trouble in the Create PR interface if the source branch changes. I.e. pushing additional commits to a source branch while you're editing the description in the Create PR interface for that branch gives you a popup with two options, BOTH of which result in the loss of your current description text.

    Other alternatives:

    1. Craft your description text in a private editor (possibly one with markdown capabilities) and save to your local disk, then paste into the BitBucket Create PR description box as the last step. This is probably the most reliable solution.
    2. Adopt a naming convention with your repo reviewers for PRs. For example in our team, PR's with a Title prefixed by "WIP:" are understood as work-in-progress that is not yet ready for review.