Skip to content

Instantly share code, notes, and snippets.

@shadyvb
Created October 2, 2013 12:01
Show Gist options
  • Select an option

  • Save shadyvb/6792634 to your computer and use it in GitHub Desktop.

Select an option

Save shadyvb/6792634 to your computer and use it in GitHub Desktop.
Default to pull-request to develop branch instead of master on github
// ==UserScript==
// @name Compare pull-requests against develop branch instead of master branch
// @namespace http://sharaf.me/
// @version 0.1
// @match https://github.com/*/compare/issue*
// @copyright 2013+, Shady Sharaf
// @run-at document-start
// ==/UserScript==
window.location.href = window.location.href.replace('compare/issue', 'compare/develop...issue')
@westonruter

Copy link
Copy Markdown

What about:

window.location.replace( window.location.href.replace('compare/issue', 'compare/develop...issue') )

And then what if the repo you're looking at doesn't have a develop branch, or if is named development? Would this cause you to always go to a 404?

@shadyvb

shadyvb commented Oct 2, 2013

Copy link
Copy Markdown
Author

Since is stone-age anyway.. but i think i'll do a small popup, on clicking a button, placed anywhere on the settings page for a repo, that will give you the choice of which branch should be set as the default base branch for pull-requests .. which stores in a cookie and be used later on redirection ..

Shouldn't be hard to do i think ..

@westonruter

Copy link
Copy Markdown

That would be awesome! Better yet would be to use localStorage

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