We all know BitBucket lacks some features that we have in other platforms like GitHub, GitLab and others. Originally inspired on Sindre Sorhus' Refined Github extension, refined-bitbucket is born as a collaborative project by a few developers to improve upon those holes, and even add some additional functionality that will enhance the overall user experience.
Adds syntax highlighting for pull requests and commits. See the full list of enabled languages here, and then here. Test them here. Missing any language? Let me know or submit a pull request!
Removes Whitespace from the FileTree Menu in the New PR UI (false by default, enable in extension options)
Double click on a word to highlight all occurrences.
Check the "Close anchor branch" checkbox by default when creating or editing pull requests.
Add last person to interact with the pull request (commit, comment or approval) to each pull request row in pull request list.
Don't carry pluses and minuses to clipboard when copying diff's contents.
Badge with the number of commits of the current pull request next to the "Commits" tab.
Set custom tab indentation size of code (Bitbucket defaults to 8 spaces) when viewing commits/pull requests.
Show a line length limit ruler, defaults to show in the 80th column
Insert "Comments" checkbox in diff header to toggle comments.
Insert "Copy filename to clipboard" button in diff header.
Define your own custom CSS styles to be applied to Bitbucket.
URLs and emails in diffs automatically become real clickable links.
Include a PULL_REQUEST_TEMPLATE.md file in the default branch of the repository in one of the locations below, and the contents of that file template will replace the default pull request body inserted by Bitbucket when creating a new one.
Please note that the filename IS case sensitive (must be all caps),
and MUST have the .md file extension. No other file extensions will be
recognized. The file to be used will be the first to be found in one
of these locations (from top to bottom).
Note: Currently, externally hosted pull request templates outside of BitBucket's domain is not supported with the Firefox addon.
Similar to how the pull request template feature works,
it is now possible to configure the extension to replace the default merge commit message for
pull requests with a template that has access to dynamically injected variables like the pull
request title, description, source and destination branch, and more.
Click here for a more in-depth explanation
Sticky Header for diffs. While scrolling down viewing a large diff, the header of that diff,
including the filename and actions, will remain visible.
Some images
Syntax highlighting
Pull request list
(notice the source branch name and creation date)
The Options page.
Diff ignore and Load all diffs
Diff ignore
Load all diffs
Collapse diff
Occurrences highlighter
Sidebar counters
Expanded
Collapsed
Sticky Header
Line length limit ruler
Compact PR File Trees
Show total lines added and removed for a pull request
Sometimes the extension is not immediately picked up by the browser after installation. If this happens to you, log out of Bitbucket and then log back in, or clear your cache.
Default Key Mapping
The following are the default key mappings
Tab Selection
Key
Action
1
Selects the Overview tab
2
Selects the Commits tab
3
Selects the Activity tab
Page Navigation and Scrolling
Upper case letters mean that you need to press shift and the letter
Contributions are very appreciated! Even if you can't contribute with a pull request, if you stumble upon any weird behavior or bugs, let us know with an issue!
If you want to run a development version of the extension, clone the repo and run the following commands:
npm install
npm run watch
This will watch any changes in the src folder and compile them to the extension folder.
Chrome Development
To test in Chrome, activate the Developer mode in chrome://extensions, click "Load unpacked extension..." and browse to that folder.
If you're new to Chrome extension development, take some time to read Google's documentation on extensions.
Firefox Development
To test in Firefox, open about:debugging in a new tab and click "Load Temporary Add-on". Navigate to the extension folder and load manifest.json. For further Firefox add-on development & debugging help, please refer to Mozilla's documentation.
Integration
There is a test suite included. Before sending a pull request please make
sure all tests are passing by running:
请发表评论