class OhlohScm::Commit

A commit is a collection of diffs united by a single timestamp, author, and message.

OpenHub’s internal data model assumes that commits are immutable, and exist in a singly-linked list. That is, commits can be nicely numbered a la Subversion, and new commits are always added to the end of the list.

This works for CVS and Subversion, but unfortunately, does not at all map to the DAG used by Git, which allows a commit to have multiple parents and children, and which allows new commits to appear during a pull which have timestamps older than previously known commits.

This means that OpenHub’s support for systems like Git is crude at best. For the near future, it is the job of the adapter to make the Git commit chain appear as much like a single array as possible.

Attributes

author_date[RW]

This object supports the idea of distinct authors and committers, a la Git. However, OpenHub will retain only one of them in its database. It prefers author, but will fall back to committer if no author is given.

author_email[RW]

This object supports the idea of distinct authors and committers, a la Git. However, OpenHub will retain only one of them in its database. It prefers author, but will fall back to committer if no author is given.

author_name[RW]

This object supports the idea of distinct authors and committers, a la Git. However, OpenHub will retain only one of them in its database. It prefers author, but will fall back to committer if no author is given.

committer_date[RW]

This object supports the idea of distinct authors and committers, a la Git. However, OpenHub will retain only one of them in its database. It prefers author, but will fall back to committer if no author is given.

committer_email[RW]

This object supports the idea of distinct authors and committers, a la Git. However, OpenHub will retain only one of them in its database. It prefers author, but will fall back to committer if no author is given.

committer_name[RW]

This object supports the idea of distinct authors and committers, a la Git. However, OpenHub will retain only one of them in its database. It prefers author, but will fall back to committer if no author is given.

diffs[RW]
directories[RW]

Hack. To optimize CVS updates, we will store the names of all the directories that require updating during this commit. OpenHub itself never actually sees this.

message[RW]
scm[RW]

A pointer back to the adapter that contains this commit.

token[RW]

The token is used to uniquely identify a commit, and can be any type of adapter-specific data.

For Subversion, the token is the revision number. For Git, the token is the commit SHA1 hash. For CVS, which does not support atomic commits with unique IDs, we use the approximate timestamp of the change.

Public Class Methods

new(params = {}) click to toggle source
# File lib/ohloh_scm/commit.rb, line 48
def initialize(params = {})
  params.each { |k, v| send(k.to_s + '=', v) if respond_to?(k.to_s + '=') }
end