Method: Git::Lib#full_log_commits

Defined in:
lib/git/lib.rb

#full_log_commits(opts = {}) ⇒ Array<Hash>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return the commits that are within the given revision range

Parameters:

  • opts (Hash) (defaults to: {})

    the given options

Options Hash (opts):

  • :count (Integer)

    the maximum number of commits to return (maps to max-count)

  • :all (Boolean)
  • :cherry (Boolean)
  • :since (String)
  • :until (String)
  • :grep (String)
  • :author (String)
  • :between (Array<String>)

    an array of two commit-ish strings to specify a revision range

    Only :between or :object options can be used, not both.

  • :object (String)

    the revision range for the git log command

    Only :between or :object options can be used, not both.

  • :path_limiter (String, Pathname, Array<String, Pathname>)

    only include commits that impact files from the specified paths

  • :skip (Integer)

Returns:

  • (Array<Hash>)

    the log output parsed into an array of hashs for each commit

    Each hash contains the following keys:

    • 'sha' [String] the commit sha
    • 'author' [String] the author of the commit
    • 'message' [String] the commit message
    • 'parent' [Array] the commit shas of the parent commits
    • 'tree' [String] the tree sha
    • 'author' [String] the author of the commit and timestamp of when the changes were created
    • 'committer' [String] the committer of the commit and timestamp of when the commit was applied
    • 'merges' [Boolean] if truthy, only include merge commits (aka commits with 2 or more parents)

Raises:

  • (ArgumentError)

    if the revision range (specified with :between or :object) is a string starting with a hyphen

See Also:



355
356
357
358
359
360
361
362
363
364
365
# File 'lib/git/lib.rb', line 355

def full_log_commits(opts = {})
  assert_args_are_not_options('between', opts[:between]&.first)
  assert_args_are_not_options('object', opts[:object])

  args = log_common_options(opts)
  args += build_args(opts, FULL_LOG_EXTRA_OPTIONS_MAP)
  args += log_path_options(opts)

  full_log = command_lines('log', *args)
  process_commit_log_data(full_log)
end