Module: AlpacaBuildTool::Git

Defined in:
lib/alpacabuildtool/tools/git.rb

Overview

Git provides methods to help with git version control tool

Class Method Summary collapse

Class Method Details

.changes(dir, commit_from = nil) ⇒ Object

Returns string with changes in dir

dir

specific dir where to look for changes

commit_from

commit from which look for changes(nil by default to

look for all changes)



11
12
13
14
# File 'lib/alpacabuildtool/tools/git.rb', line 11

def self.changes(dir, commit_from = nil)
  return `git log -- #{dir}` unless commit_from
  `git log #{commit_from}..HEAD -- #{dir}`
end

.revisionObject

Returns current revision id



18
19
20
# File 'lib/alpacabuildtool/tools/git.rb', line 18

def self.revision
  `git rev-parse HEAD`
end