Skip to content

Instantly share code, notes, and snippets.

@uehaj
Last active August 29, 2015 14:14
Show Gist options
  • Save uehaj/d07e5062f602d69c431b to your computer and use it in GitHub Desktop.
Save uehaj/d07e5062f602d69c431b to your computer and use it in GitHub Desktop.
直近の10個のログから、修正量の多い順にファイル名を表示する
class ShowTestTarget {
static void main(args) {
"git log -10 --numstat --pretty=<@>%s".execute().text.split(/<@>/).drop(1).collect{it.split(/\n/).drop(2)}.flatten().collectMany { def m= (it=~ /(\d+)\W+(\d+)\W+(.*)/); m.matches()?[(m.collect{it}[0][1..-1])]:[] }.sort{-(Integer.parseInt(it[0])+Integer.parseInt(it[1]))}.each {
println it[2]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment