Skip to content

Instantly share code, notes, and snippets.

@ktomk
Forked from asev/bitbucket_load_all_diffs.js
Created October 1, 2019 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ktomk/f04d5de6c9a5ac509bc95c8559e4e2e3 to your computer and use it in GitHub Desktop.
Save ktomk/f04d5de6c9a5ac509bc95c8559e4e2e3 to your computer and use it in GitHub Desktop.
Bitbucket load all diffs in pull request
/* Add this line to bookmarks and use when you see
* "Oops! You've got a lot of code in this diff and it couldn't load with the page."
* on a pull request at Bitbucket.
*/
javascript:(function(){[].forEach.call(document.querySelectorAll(".load-diff"),function(a){a.click()})})();
@ktomk
Copy link
Author

ktomk commented Oct 1, 2019

Additionally if you want to hide all paths which have an equal number of changed lines (+ / - the same):

javascript:(function(){[].forEach.call(document.querySelectorAll("ul#commit-files-summary .commit-file-diff-stats"), function(e) {const v = (i) => parseInt(e.getElementsByTagName("span")[i].textContent.trim(), 10); (0 == v(0) + v(1)) && (e.parentElement.style.display = 'none');});})();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment