Skip to content

Instantly share code, notes, and snippets.

@notyy
Created August 22, 2012 03:33
Show Gist options
  • Save notyy/3422084 to your computer and use it in GitHub Desktop.
Save notyy/3422084 to your computer and use it in GitHub Desktop.
extract user story
#!/bin/sh
exec scala -nc "$0" "$@"
!#
import scala.io._
val source = if(args.length>0) Source.fromFile(args(0)).getLines else Source.stdin.getLines
val pattern = """([a-zA-Z]+)-(\d+)""".r
source.flatMap(pattern.findFirstIn).toList.distinct.foreach(println)
//=============USAGE======================
you can git log > txt file, then pass the txt file path to this script
or
you can pipe git log to it : git log | script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment