Class: GitReviewNotes::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/git_review_notes/cli.rb

Instance Method Summary collapse

Instance Method Details

#commits(*commits_shas) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'lib/git_review_notes/cli.rb', line 18

def commits(*commits_shas)
  commits = commits_shas.map {|sha| git.object(sha)}
  add_reviewed_by(commits)

  commits_shas.each do |commit_sha|
    system "git log -1 #{commit_sha}"
    puts
  end
  ask_for_pushing_review(commits)
end

#reviewObject



7
8
9
10
11
12
13
14
15
# File 'lib/git_review_notes/cli.rb', line 7

def review
  raise "Current branch is master. Exiting..." if git.current_branch == 'master'

  current_branch_commits = git.log.between("master", git.current_branch)
  add_reviewed_by(current_branch_commits)

  system "git log master..#{git.current_branch}"
  ask_for_pushing_review(current_branch_commits)
end