GitHub Code Review Assistant
DEPRECATION NOTE
The project is no longer maintained and left here for historical reasons.
Since GitHub is evolving at a steady pace and updating the script would require a regular effort, and since I use GitHub way less often than before, I will no longer maintain the script for now.
However, see instead: https://github.com/sindresorhus/refined-github
What's that?
Github Assistant is a UserScript, i.e. a piece of JavaScript code, that runs in your browser on Github pages to enhance your code review experience:
- Mark the files as Reviewed / Rejected (this is stored in browser's local storage, so you can safely reload the page or close the browser and come back later).
- Expand / collapse files comprising the diff individually (by clicking the header of each file).
- Configure the script to collapse the files automatically if there are >N files or the diff is >M lines.
- A footer and sidebar are added next to each file to quickly jump to its top.
- Serialize & export the code review status into the URL's hash
Works on /commit
, /pull
, /compare
pages.
Configuration
You can configure all the options right from the config dialog in the browser.
Scroll to the bottom of any pull request and you will see a number of buttons added by the script.
Preview
Supported browsers
Firefox, Chrome (should work on any reasonably modern version), Opera 12.
Installation guide
Firefox
- Install GreaseMonkey and restart the browser.
- Navigate to ghAssistant.user.js on GitHub.
- You should see an installation prompt. Accept the installation.
- GH Assistant should work right away.
Chrome
- Install TamperMonkey.
- Navigate to ghAssistant.user.js on GitHub.
- You should see an installation prompt. Click "OK" (Install with Tampermonkey).
- GH Assistant should work right away.
Opera 12
-
Launch the following addresses to configure the browser: set the directory on your disk where to store UserScripts, and activate UserScripts on HTTPS (GitHub is served via HTTPS):
opera:config#UserPrefs|UserJavaScriptFile opera:config#UserPrefs|UserJavaScriptonHTTPS
-
Download the ghAssistant.user.js and put it in the UserScripts folder declared above.
-
Restart the browser.
Updates
The userscript has an URL to this GitHub repo in its metadata. Hence in Firefox and Chrome you can benefit from easy updates.
Firefox
Go to about:addons
(or Tools > Addons
from Firefox menu, or Ctrl+Shift+A
from keyboard) to GreaseMonkey tab.
Right click on the entry and choose "Find updates".
If you opted in to have automatic updates in Firefox, the same setting will also apply to GreaseMonkey which will periodically automatically check for updates of UserScripts.
Chrome
Open Tampermonkey menu > Options
. Select the entry and choose "Trigger an update" from the dropdown.
Tampermonkey also checks for UserScripts updates periodically (configurable in extension's settings; default is 12h).
Opera 12
AFAIK you'll have to do it manually.
Checking if the extension works
Navigate to some of the /commit, /pull, or /compare URL on Github. The longer the diff, the better you'll see the advantages of the script.
Example: ariatemplates # pull 427
I like it!
Spread the word and and star this repo on GitHub. Fork it and submit patches if you found bugs.
You may also like some other of my userscripts:
- GitHub: hide pull requests from issues page
- GitHub: go to pull request branch from pull request
- Wiki language switcher
- and several other
See them on Github or Userscripts.org
Author's homepage: jakub-g.github.io
Credits
This extension was developed using the following Firefox extensions:
Credits to all the respective authors.