Class: Git::Commands::Tag::List Private

Inherits:
Base
  • Object
show all
Defined in:
lib/git/commands/tag/list.rb

Overview

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

Note:

arguments block audited against https://git-scm.com/docs/git-tag/2.53.0

Implements the git tag --list command

This command lists existing tags with optional filtering and sorting.

Examples:

Basic tag listing

list = Git::Commands::Tag::List.new(execution_context)
tags = list.call

List tags matching a pattern

list = Git::Commands::Tag::List.new(execution_context)
tags = list.call('v1.*')

List tags containing a commit

list = Git::Commands::Tag::List.new(execution_context)
tags = list.call(contains: 'abc123')

List tags with multiple patterns

list = Git::Commands::Tag::List.new(execution_context)
tags = list.call('v1.*', 'v2.*', sort: 'version:refname')

See Also:

Instance Method Summary collapse

Methods inherited from Base

allow_exit_status, arguments, #initialize, requires_git_version, skip_version_validation

Constructor Details

This class inherits a constructor from Git::Commands::Base

Instance Method Details

#call(*pattern, **options) ⇒ Git::CommandLine::Result

Execute the git tag --list command

Parameters:

  • pattern (Array<String>) —

    shell wildcard patterns to filter tags

    Multiple patterns can be provided; a tag is shown if it matches any pattern.

  • options (Hash) —

    command options

Options Hash (**options):

  • :n (Boolean, Integer, nil) — default: nil —

    number of annotation lines to print

    Pass true to print the first annotation line, or an integer to print that many lines. If the tag is not annotated, the commit message is displayed instead.

  • :sort (String, Array<String>) — default: nil —

    sort tags by the specified key(s)

    Prefix - to sort in descending order. Common keys: 'refname', '-refname', 'creatordate', '-creatordate', and 'version:refname'.

  • :color (Boolean, String, nil) — default: nil —

    colorize output per colors specified in --format

    Pass true for --color, or one of 'always', 'never', 'auto'.

  • :ignore_case (Boolean, nil) — default: nil —

    sort and filter tags without case sensitivity

    Alias: :i

  • :omit_empty (Boolean, nil) — default: nil —

    skip trailing newlines for refs whose formatted output is empty

  • :column (Boolean, String, nil) — default: nil —

    display tag listing in columns

    Pass true for --column or a comma-separated options string for --column=<options>.

  • :no_column (Boolean, nil) — default: nil —

    disable column output (--no-column)

  • :contains (Boolean, String, nil) — default: nil —

    list only tags that contain the specified commit

    Pass true to use HEAD, or a commit reference string.

  • :no_contains (Boolean, String, nil) — default: nil —

    list only tags that do not contain the specified commit

    Pass true to use HEAD, or a commit reference string.

  • :merged (Boolean, String, nil) — default: nil —

    list only tags whose commits are reachable from the specified commit

    Pass true to use HEAD, or a commit reference string.

  • :no_merged (Boolean, String, nil) — default: nil —

    list only tags whose commits are not reachable from the specified commit

    Pass true to use HEAD, or a commit reference string.

  • :points_at (Boolean, String, nil) — default: nil —

    list only tags that point at the specified object

    Pass true to use HEAD, or an object reference string.

  • :format (String) — default: nil —

    output format string for each tag

Returns:

Raises:

  • (ArgumentError) —

    if unsupported options are provided

  • (Git::FailedError) —

    if git exits with a non-zero exit status



# File 'lib/git/commands/tag/list.rb', line 65