Method: Git::Lib#describe

Defined in:
lib/git/lib.rb

#describe(commit_ish = nil, opts = {}) ⇒ String

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.

Finds most recent tag that is reachable from a commit

Parameters:

  • commit_ish (String, nil) (defaults to: nil)

    target commit sha or object name

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

    the given options

Options Hash (opts):

  • :all (Boolean)
  • :tags (Boolean)
  • :contains (Boolean)
  • :debug (Boolean)
  • :long (Boolean)
  • :always (Boolean)
  • :exact_match (Boolean)
  • :dirty (true, String)
  • :abbrev (String)
  • :candidates (String)
  • :match (String)

Returns:

  • (String)

    the tag name

Raises:

  • (ArgumentError)

    if the commit_ish is a string starting with a hyphen

See Also:



245
246
247
248
249
250
251
252
# File 'lib/git/lib.rb', line 245

def describe(commit_ish = nil, opts = {})
  assert_args_are_not_options('commit-ish object', commit_ish)

  args = build_args(opts, DESCRIBE_OPTION_MAP)
  args << commit_ish if commit_ish

  command('describe', *args)
end