Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/refined-bitbucket/refined-bitbucket

Chrome and Firefox extension that improves Bitbucket's user experience
https://github.com/refined-bitbucket/refined-bitbucket

bitbucket chrome chrome-extension firefox firefox-addon highlight pull-requests

Last synced: about 2 months ago
JSON representation

Chrome and Firefox extension that improves Bitbucket's user experience

Awesome Lists containing this project

README

        

[![build status](https://travis-ci.org/refined-bitbucket/refined-bitbucket.svg?branch=test-it)](https://travis-ci.org/refined-bitbucket/refined-bitbucket)
-
[![downloads](https://img.shields.io/chrome-web-store/d/afppminkfnfngihdocacbgeajbbdklkf.svg)](https://chrome.google.com/webstore/detail/refined-bitbucket/afppminkfnfngihdocacbgeajbbdklkf?utm_source=chrome-ntp-icon)
-
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

![Refined BitBucket](./logo-full.svg)

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](https://github.com/sindresorhus/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.

[Subscribe to this issue if you would like to receive e-mail notifications on updates](https://github.com/refined-bitbucket/refined-bitbucket/issues/182).

## Current features

- Adds syntax highlighting for pull requests and commits. See the full list of enabled languages [here][prismjs-languages], and then [here][language-ext]. [Test them here](http://prismjs.com/test.html). Missing any language? [Let me know](https://github.com/refined-bitbucket/refined-bitbucket/issues) 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.
- ~~Block pull request merging without a minimum number of approvals (defaults to 2 minimum approvals).~~ Removed. [Implemented natively by Bitbucket with "merge checks"](https://confluence.atlassian.com/bitbucketserver/checks-for-merging-pull-requests-776640039.html)
- Key binding feature, which allows for quicker navigation through pull requests.
- Button to collapse pull request descriptions.
- Button to collapse diffs in Pull Request and Commits view.
- Autocollapse:
- Add filename patterns in the Options page that you would like the extension to collapse automatically when the pull request or commit loads.
- Deleted files are automatically collapsed.
- Diff Ignore. Add filename patterns in the Options page that you would like the extension to completely remove when the pull request or commit loads.
- Counters for open or active branches and pull requests in the sidebar navigation menu.
- Button to load all failed diffs in pull request and commit view.
- Adds 'Create Pull Request' link to the 'Compare branches and tags' page.
- Choose a default merge strategy for your pull requests. [Also implemented natively by Bitbucket per project](https://bitbucket.org/site/master/issues/13895/default-merge-strategy#comment-45364593)
- 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.

```
/PULL_REQUEST_TEMPLATE.md
/docs/PULL_REQUEST_TEMPLATE.md
/.github/PULL_REQUEST_TEMPLATE.md
/.bitbucket/PULL_REQUEST_TEMPLATE.md
```

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).

It's also possible to specify a URL for a raw Gist with the contents
of the template in the options page, in case you don't want to include
the file in your repository, e.g., https://gist.githubusercontent.com/anonymous/8054a3ee32f7cf1a5975e3fd52b3c5f3/raw/f6897720e8b6b93becd246187dac36038291c3a4/PULL_REQUEST_TEMPLATE.md.

_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](https://github.com/refined-bitbucket/refined-bitbucket/pull/243)

- 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




syntax-hl1
syntax-hl2



Pull request list

(notice the source branch name and creation date)




source-branch



The Options page.



Diff ignore and Load all diffs




options


Diff ignore

pullrequest-ignore




Load all diffs

load-all-diffs



Collapse diff


Occurrences highlighter




collapse-diff
bottom-collapse


occurrences-highlighter



Sidebar counters




expanded

Expanded


collapsed

Collapsed



Sticky Header


Line length limit ruler




Sticky Header


Line length limit ruler



Compact PR File Trees




compactTree



Show total lines added and removed for a pull request




total lines added and removed for PR

## Installing

_refined-bitbucket_ is available on the [Google Chrome Web Store][chrome-install] and [Add-ons for Firefox][firefox-install]. When installed, go check the extension's Options to customize it to your needs.

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

![bitbucket pull request tabs][tab-image]

| 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_

| Key | Action |
| ------------------------- | ------------------------------------------------ |
| N (Shift+n) | Scrolls to the **N**ext comment on the page. |
| P (Shift+p) | Scrolls to the **P**revious comment on the page. |
| g g | Scrolls to the top of the page |
| G (Shift+g) | Scrolls to the bottom of the page |

## Can I use this on Bitbucket Server?

Sadly, no :(. Although Bitbucket Server and Bitbucket Cloud share a similar name, both are actually two completely different products. [Read this comment for a more detailed explanation](https://github.com/refined-bitbucket/refined-bitbucket/issues/39#issuecomment-338455398).

## Compiling & Contributing

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:

```bash
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](https://developer.chrome.com/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](https://developer.mozilla.org/en-US/Add-ons).

#### Integration

There is a test suite included. Before sending a pull request please make
sure all tests are passing by running:

```bash
npm test
```

## License

MIT © [refined-bitbucket](https://github.com/refined-bitbucket)

[chrome-install]: https://chrome.google.com/webstore/detail/refined-bitbucket/afppminkfnfngihdocacbgeajbbdklkf?utm_source=chrome-ntp-icon
[firefox-install]: https://addons.mozilla.org/en-US/firefox/addon/refined-bitbucket-/
[tab-image]: https://cloud.githubusercontent.com/assets/755669/18594922/1c74c184-7bf7-11e6-887d-859fb6206c65.png
[prismjs-languages]: http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+abap+actionscript+ada+apacheconf+apex+apl+applescript+c+asciidoc+asm6502+aspnet+autohotkey+autoit+bash+basic+batch+bison+brainfuck+bro+cpp+csharp+arduino+coffeescript+ruby+csp+css-extras+d+dart+diff+django+docker+eiffel+elixir+elm+erlang+fsharp+flow+fortran+gherkin+git+glsl+go+graphql+groovy+haml+handlebars+haskell+haxe+hcl+http+hpkp+hsts+ichigojam+icon+inform7+ini+io+j+java+jolie+json+julia+keyman+kotlin+latex+less+livescript+lolcode+lua+makefile+markdown+matlab+mel+mizar+monkey+n4js+nasm+nginx+nim+nix+nsis+objectivec+ocaml+opencl+oz+parigp+parser+pascal+perl+php+php-extras+powershell+processing+prolog+properties+protobuf+pug+puppet+pure+python+q+qore+r+jsx+typescript+renpy+reason+rest+rip+roboconf+crystal+rust+sas+sass+scss+scala+scheme+smalltalk+smarty+sql+stylus+swift+tcl+textile+twig+tsx+vbnet+verilog+vhdl+vim+wiki+xeora+xojo+yaml#category-languages
[language-ext]: https://github.com/refined-bitbucket/refined-bitbucket/blob/dev/src/syntax-highlight/language-ext.js