class Git::Object::Commit

def author

git author
def author
  check_commit
  @author
end

def author_date

def author_date
  author.date
end

def check_commit

see if this object has been initialized and do so if not
def check_commit
  return if @tree
  data = @base.lib.cat_file_commit(@objectish)
  set_commit(data)
end

def commit?

def commit?
  true
end

def committer

git author
def committer
  check_commit
  @committer
end

def committer_date

def committer_date
  committer.date
end

def diff_parent

def diff_parent
  diff(parent)
end

def gtree

def gtree
  check_commit
  Tree.new(@base, @tree)
end

def initialize(base, sha, init = nil)

def initialize(base, sha, init = nil)
  super(base, sha)
  @tree = nil
  @parents = nil
  @author = nil
  @committer = nil
  @message = nil
  if init
    set_commit(init)
  end
end

def message

def message
  check_commit
  @message
end

def name

def name
  @base.lib.name_rev(sha)
end

def parent

def parent
  parents.first
end

def parents

array of all parent commits
def parents
  check_commit
  @parents
end

def set_commit(data)

def set_commit(data)
  @sha ||= data['sha']
  @committer = Git::Author.new(data['committer'])
  @author = Git::Author.new(data['author'])
  @tree = Git::Object::Tree.new(@base, data['tree'])
  @parents = data['parent'].map{ |sha| Git::Object::Commit.new(@base, sha) }
  @message = data['message'].chomp
end