justinleveck
1/21/2014 - 9:48 PM

Stash - Branch Input

Stash - Branch Input

Stash - Branch input box

This will hide the branch span tag and insert an input box with the git checkout branch command to allow for easy cutting & pasting

Usage

Tripple click input to copy git co branch command Double click over branch name to copy only branch name

  1. Install Chrome extension
  1. Visit Stash pull request

  2. Click yellow JS Icon

  3. Paste in below code

var branch = jQuery("span.source-branch span.ref.branch span.name").first().text();
jQuery("span.source-branch span.ref.branch span.name").first().hide();
jQuery("span.source-branch span.ref.branch span.name").first().parent().append('<input value="git co '+ branch +'" type="text"></input>');    console.log( "ready!" );

if(jQuery("td.source")) {
 jQuery("td.source span.ref.branch span.name").each(function() {
  var branch = jQuery(this).text();
  jQuery(this).hide();
  jQuery(this).parent().append('<input value="git co '+ branch +'" type="text"></input>');    console.log( "ready!" );
}); 
}
  1. Click 'Autostart'

  2. Click Save icon

  3. Reload page & profit