Sha256: fa9a649abd3e42826282359b573809739067dbd6a768a15fcf85ed7c1e663d9e

Contents?: true

Size: 740 Bytes

Versions: 5

Compression:

Stored size: 740 Bytes

Contents

# frozen_string_literal: true

command :log do
  desc 'Print all commits in a range nicely'

  option '--from [REF]', 'Commit to start from (default: beginning of time)' do |value, options|
    options[:from] = value
  end

  option '--to [REF]', 'Commit to finish with (default: current branch)' do |value, options|
    options[:to] = value
  end

  action do |context|
    require 'schmersion/repo'
    require 'schmersion/helpers'
    require 'colorize'

    repo = Schmersion::Repo.new(FileUtils.pwd)

    from = context.options[:from] || :start
    to = context.options[:to] || repo.current_branch

    commits = repo.commits(from, to, exclude_with_invalid_messages: true)

    Schmersion::Helpers.print_commit_list(commits)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
schmersion-1.1.3 cli/log.rb
schmersion-1.1.2 cli/log.rb
schmersion-1.1.0 cli/log.rb
schmersion-1.0.1 cli/log.rb
schmersion-1.0.0 cli/log.rb