lib/rake/common/git.rb in rake-delphi-0.0.13 vs lib/rake/common/git.rb in rake-delphi-0.0.14
- old
+ new
@@ -31,11 +31,11 @@
attr_reader :opts, :changelog, :processed
def initialize(task, opts)
super(task)
- @opts = {:filter => '.'}
+ @opts = {:filter => '.', :format => '%B'}
@opts.merge!(opts) if opts.kind_of?(Hash)
@changelog = @processed = []
get_changelog
yield self if block_given?
end
@@ -50,10 +50,12 @@
private
def get_changelog
cmd = ['git']
cmd << "-c i18n.logOutputEncoding=#{opts[:logoutputencoding]}" if opts[:logoutputencoding]
- cmd << 'log' << '--format=%B' << "#{opts[:since]}..HEAD"
+ # if :since is not set, do not use range
+ rev = (opts[:since].to_s.empty? ? '' : "#{opts[:since]}..") + 'HEAD'
+ cmd << 'log' << "--format=#{opts[:format]}" << rev
Logger.trace(Logger::VERBOSE, cmd)
@changelog=%x[#{cmd.join(' ')}].lines.to_a
@changelog.map! do |line|
line.chomp!
if line.respond_to?(:force_encoding) \