Sha256: 6971367b061f87ed7ac2a76269d90fde5bd441cb5c14faec16cde3db6b3b821d

Contents?: true

Size: 1011 Bytes

Versions: 3

Compression:

Stored size: 1011 Bytes

Contents

#!/usr/bin/env ruby
# encoding: UTF-8
#
# git-outstanding-features --
#
# List merged pull requests.
#
require 'rubygems'
require 'optparse'
require 'term/ansicolor'
require 'git-whistles/app'

class App < Git::Whistles::App

  def initialize
    super
  end

  def main(args)
    super
    parse_args!(args)

    puts `git log --oneline #{options.from} ^#{options.to} | grep 'Merge pull request' | sed  -e 's:.*from [^/]*/::'`
  end

  def defaults
    {
      :from => 'origin/master',
      :to   => 'origin/production'
    }
  end

  def option_parser
    @option_parser ||= OptionParser.new do |op|
      op.banner = "Usage: git outstanding-features --from [FROM-BRANCH] --to [TO-BRANCH]"

      op.on("-f", "--from [BRANCH]", "From branch") do |from|
        options.from = from
      end

      op.on("-t", "--to [BRANCH]", "To branch") do |to|
        options.to = to
      end

      op.on_tail("-h", "--help", "Show this message") do
        puts op
        exit
      end
    end
  end
end

App.run!

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
git-whistles-0.7.4 bin/git-outstanding-features
git-whistles-0.7.3 bin/git-outstanding-features
git-whistles-0.7.2 bin/git-outstanding-features