lib/poise_boiler/helpers/rake/check.rb
# Check for any commits that are not part of a release. Unpushed commits
# are displayed in red.
#
# @params git [Git::Base] Git repository to operate on.
# @return [Array]
Check for any commits that are not part of a release. Unpushed commits
are displayed in red.
Check for any commits that are not part of a release . Unpushed commits are displayed in red .
def check_commits(git)
          last_release = if git.tags.empty?
            git.log.last
          else
            git.tags.last
          end
          commits = git.log.between(last_release.sha, 'master').select do |commit|
            if commit.message !~ /^bump.*for/i
              changed_files = commit.diff_parent.stats[:files].keys
              if changed_files.size != 1 || changed_files.first !~ /lib\/.*\/version\.rb/
                true
              end
            end
          end
          pushed_commits = git.log.between(last_release.sha, 'origin/master').inject(Set.new) do |memo, commit|
            memo << commit.sha
            memo
          end
          commits.map {|commit| [commit, pushed_commits.include?(commit.sha), last_release] }
        end
def check_commits ( git ) last_release = if git . tags . empty? git . log . last else git . tags . last end commits = git . log . between ( last_release . sha , 'master' ) . select do | commit | if commit . message !~ / ^bump.*for /i changed_files = commit . diff_parent . stats [ :files ] . keys if changed_files . size != 1 || changed_files . first !~ / lib \/ .* \/ version \. rb / true end end end pushed_commits = git . log . between ( last_release . sha , 'origin/master' ) . inject ( Set . new ) do | memo , commit | memo << commit . sha memo end commits . map { | commit | [ commit , pushed_commits . include? ( commit . sha ) , last_release ] } end
Check for any commits that are not part of a release.
Check for any commits that are not part of a release .
# Find either the latest tag (release) or the first commit in the repo. # Find all commits since the last release that are not only version bumps. # Find all pushed commits since the last release.
None
Array
git
<not_specific>
params
git [Git::Base] Git repository to operate on.
git [ Git :: Base ] Git repository to operate on .