Class Grit::Commit
In: lib/grit/commit.rb
Parent: Object

Methods

actor   author_string   count   create   create_initialize   date   diff   diffs   find_all   id_abbrev   inspect   lazy_source   list_from_string   new   notes   parse_batch   sha   show   stats   to_hash   to_patch   to_s  

Attributes

id  [R] 
repo  [R] 

Public Class methods

Parse out the actor (author or committer) info

Returns [String (actor name and email), Time (acted at time)]

Count the number of commits reachable from this ref

  +repo+ is the Repo
  +ref+ is the ref from which to begin (SHA1 or name)

Returns Integer

Create an unbaked Commit containing just the specified attributes

  +repo+ is the Repo
  +atts+ is a Hash of instance variable data

Returns Grit::Commit (unbaked)

Show diffs between two trees.

repo - The current Grit::Repo instance. a - A String named commit. b - An optional String named commit. Passing an array assumes you

          wish to omit the second named commit and limit the diff to the
          given paths.

paths - An optional Array of paths to limit the diff. options - An optional Hash of options. Merged into {:full_index => true}.

Returns Grit::Diff[] (baked)

Find all commits matching the given criteria.

  +repo+ is the Repo
  +ref+ is the ref from which to begin (SHA1 or name) or nil for --all
  +options+ is a Hash of optional arguments to git
    :max_count is the maximum number of commits to fetch
    :skip is the number of commits to skip

Returns Grit::Commit[] (baked)

Parse out commit information into an array of baked Commit objects

  +repo+ is the Repo
  +text+ is the text output from the git command (raw format)

Returns Grit::Commit[] (baked)

really should re-write this to be more accepting of non-standard commit messages

  • it broke when ‘encoding’ was introduced - not sure what else might show up

Instantiate a new Commit

  +id+ is the id of the commit
  +parents+ is an array of commit ids (will be converted into Commit instances)
  +tree+ is the correspdonding tree id (will be converted into a Tree object)
  +author+ is the author string
  +authored_date+ is the authored Time
  +committer+ is the committer string
  +committed_date+ is the committed Time
  +message+ is an array of commit message lines

Returns Grit::Commit (baked)

Parses output from the `git-cat-file —batch’.

repo - Grit::Repo instance. sha - String SHA of the Commit. size - Fixnum size of the object. object - Parsed String output from `git cat-file —batch`.

Returns an Array of Grit::Commit objects.

Public Instance methods

Initializer for Commit.create

  +repo+ is the Repo
  +atts+ is a Hash of instance variable data

Returns Grit::Commit (unbaked)

Shows diffs between the commit‘s parent and the commit.

options - An optional Hash of options, passed to Grit::Commit.diff.

Returns Grit::Diff[] (baked)

Pretty object inspection

Convert this Commit to a String which is just the SHA1 id

[Validate]