Created
April 30, 2012 21:23
-
-
Save thehadeeryounis/2562797 to your computer and use it in GitHub Desktop.
Filter Commit Messages by Committer on code.google.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Load jQuery. | |
*/ | |
javascript:if(!window.jQuery||confirm('Overwrite\x20current\x20version?\x20v'+jQuery.fn.jquery))(function(d,h,s){s=d.createElement('script');s.type='text/javascript';s.src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';((h=document.head)||(h=document.getElementsByTagName('head'),h?h[0]:document.body)||document.documentElement).appendChild(s)})(document); | |
/** | |
* Then execute the rest. | |
*/ | |
var results = ''; | |
var username = "username"; //Committer username | |
var exp = "issue [0-9]+" //regex matching to smart commits | |
//The following two flags can be both true at the same time | |
var filter = false; //true means filter by username | |
var regex = true; //true means filter by regex | |
init(); | |
function init() | |
{ | |
var num = $('.pagination:first').text().split('of')[1].split('Older')[0].trim() | |
$('#colcontrol').load('list?num=1000&start='+num+' #colcontrol',function(){ | |
results = $('#resultstable>tbody').clone(); | |
paginate(); | |
}); | |
} | |
function paginate() | |
{ | |
if($('.pagination a:last:contains(Older)').length > 0) | |
{ | |
$('#colcontrol').load($('.pagination a:last:contains(Older)').attr('href')+' #colcontrol',function(){ | |
$(results).append($('#resultstable>tbody').html()); | |
paginate(); | |
}); | |
} | |
else | |
{ | |
finish(); | |
} | |
} | |
function finish() | |
{ | |
if(filter) | |
do_filter(); | |
if(regex) | |
do_regex(); | |
} | |
function do_filter() | |
{ | |
$('#resultstable').html(results) | |
$('#resultstable>tbody>tr + tr').hide(); | |
$('*:contains('+username+')').closest('tr').show() | |
} | |
function do_regex() | |
{ | |
$('#resultstable>tbody>tr + tr:visible').each(function(){ | |
if(!$(this).text().match(exp)) | |
$(this).hide() | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment