Sha256: 0e66799de65e54b424415bf1a94834221022b82a9b0d8ab0c29649c1778318de

Contents?: true

Size: 1.94 KB

Versions: 36

Compression:

Stored size: 1.94 KB

Contents

module OhlohScm
	# A commit is a collection of diffs united by a single timestamp, author, and
	# message.
	#
	# Ohloh'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 Ohloh'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.
	#
	class Commit
		# This object supports the idea of distinct authors and committers, a la
		# Git.  However, Ohloh will retain only one of them in its database. It
		# prefers author, but will fall back to committer if no author is given.
		attr_accessor :author_name, :author_email, :author_date, :committer_name, :committer_email, :committer_date

		attr_accessor :message

		attr_accessor :diffs

		# 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.
		attr_accessor :token

		# A pointer back to the adapter that contains this commit.
		attr_accessor :scm

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

		def initialize(params={})
			params.each { |k,v| send(k.to_s + '=', v) if respond_to?(k.to_s + '=') }
		end
	end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
ohloh_scm-2.5.1 lib/ohloh_scm/commit.rb
ohloh_scm-2.4.14 lib/ohloh_scm/commit.rb
ohloh_scm-2.4.13 lib/ohloh_scm/commit.rb
ohloh_scm-2.4.12 lib/ohloh_scm/commit.rb
ohloh_scm-2.4.11 lib/ohloh_scm/commit.rb
ohloh_scm-2.4.10 lib/ohloh_scm/commit.rb
ohloh_scm-2.4.9 lib/ohloh_scm/commit.rb
ohloh_scm-2.4.8 lib/ohloh_scm/commit.rb
ohloh_scm-2.4.7 lib/ohloh_scm/commit.rb
ohloh_scm-2.4.6 lib/ohloh_scm/commit.rb
ohloh_scm-2.4.5 lib/ohloh_scm/commit.rb
ohloh_scm-2.4.4 lib/ohloh_scm/commit.rb
ohloh_scm-2.4.3 lib/ohloh_scm/commit.rb
ohloh_scm-2.4.1 lib/ohloh_scm/commit.rb
ohloh_scm-2.4.0 lib/ohloh_scm/commit.rb
ohloh_scm-2.3.5 lib/ohloh_scm/commit.rb
ohloh_scm-2.3.4 lib/ohloh_scm/commit.rb
ohloh_scm-2.3.2 lib/ohloh_scm/commit.rb
ohloh_scm-2.3.1 lib/ohloh_scm/commit.rb
ohloh_scm-2.3.0 lib/ohloh_scm/commit.rb