2

When learning new things about programming, i find it useful to study pull requests. And what i mean by that, is study the diff offered in the browser.

When using Bitbucket, i have tried many ways to save the PR from the browser.

I tried all different Save Page As. However, when that happens, i get a message that Something went wrong. Obviously, a protection mechanism from Bitbucket. Even when i select HTML Only.

When i select the code portion and i press Print, followed by Export to PDF then the exported pdf is a mess, and you cannot see anything.

I searched the internet and i found no information on how to save the data from a particular pull request. It is sad to have the full code on your repository, but not being able to study a particular pull request, so you can understand things in a targeted way. At least offline.

If anyone knows some tricks, i would be really interested in learning them.

user1584421
  • 3,499
  • 11
  • 46
  • 86
  • Are you intending on reviewing the code or the comments of a PR offline? Maybe something like https://diff2html.xyz/demo.html is a suitable tool? – Entimon Feb 16 '22 at 21:04
  • @Entimon This is great! But can it work with private BitBucket repos? – user1584421 Feb 17 '22 at 09:21
  • @Entimon I just saw there is a CLI version. So i can use this. But do you know how i can give a specific PR as input? There is no example like this here: https://github.com/rtfpessoa/diff2html-cli#readme – user1584421 Feb 17 '22 at 09:33
  • 1
    I'm not sure if there is an easy way to use the cli with bitbucket directly, but if you have the repository cloned locally and the PR is just a branch there you can do something like `git checkout my-feature-branch` and then `git diff master | diff2html -i stdin -F diff.html` which will print the diff to "diff.html" – Entimon Feb 17 '22 at 09:50
  • Thanks but this did not work. It produced too many files that were unrelated to this PR. Keep in mind that this PR happened a while ago. Maybe what you wrote compared the branch with the master at the current time? – user1584421 Feb 17 '22 at 10:29
  • I am exploring this answer: https://stackoverflow.com/questions/37763836/how-to-make-git-diff-show-the-same-result-as-githubs-pull-request-diff. Does this sound familiar to you? – user1584421 Feb 17 '22 at 10:36

0 Answers0