Sha256: 7345e69e158f885752ca2ad9902fb41ff1bc31b9698dfd0d862504daa0a9c66a

Contents?: true

Size: 1.06 KB

Versions: 3

Compression:

Stored size: 1.06 KB

Contents

require 'pivotal-github/command'
require 'pivotal-github/finished_command'

class StoryMerge < FinishedCommand

  def parser
    OptionParser.new do |opts|
      opts.banner = "Usage: git story-merge [options]"
      opts.on("-d", "--development BRANCH",
              "development branch (defaults to master)") do |opt|
        self.options.development = opt
      end
      opts.on("-f", "--force", "override unfinished story warning") do |opt|
        self.options.run = opt
      end
      opts.on_tail("-h", "--help", "this usage guide") do
        puts opts.to_s; exit 0
      end
    end
  end

  # Returns a command appropriate for executing at the command line
  # For example:
  #   git checkout master
  #   git merge --no-ff <story branch>
  def cmd
    lines = ["git checkout #{development_branch}"]
    c = ['git merge --no-ff --log']
    c << argument_string(unknown_options) unless unknown_options.empty?
    c << story_branch
    lines << c.join(' ')
    lines.join("\n")
  end

  private

    def development_branch
      options.development || 'master'
    end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pivotal-github-0.6.9 lib/pivotal-github/story_merge.rb
pivotal-github-0.6.8 lib/pivotal-github/story_merge.rb
pivotal-github-0.6.7 lib/pivotal-github/story_merge.rb