Class: Git::Commands::ConfigOptionSyntax::List Private

Inherits:
Base
  • Object
show all
Defined in:
lib/git/commands/config_option_syntax/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-config/2.53.0

List all config entries

Wraps git config --list to output all config entries visible from the current scope.

Examples:

List all config entries

cmd = Git::Commands::ConfigOptionSyntax::List.new(lib)
cmd.call

List global config entries

cmd = Git::Commands::ConfigOptionSyntax::List.new(lib)
cmd.call(global: true)

List entries from a specific file

cmd = Git::Commands::ConfigOptionSyntax::List.new(lib)
cmd.call(file: '/path/to/config')

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(**options) ⇒ Git::CommandLineResult

Execute the git config --list command

Parameters:

  • options (Hash)

    command options

Options Hash (**options):

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

    list only global config entries

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

    list only system config entries

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

    list only repository config entries

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

    list only worktree config entries

  • :file (String) — default: nil

    list entries from the specified file

    Alias: :f

  • :blob (String) — default: nil

    list entries from the specified blob

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

    respect include directives in config files (--includes)

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

    suppress include directive processing (--no-includes)

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

    show the origin of each config entry

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

    show the scope of each config entry

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

    terminate values with NUL byte instead of newline

    Alias: :z

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

    output only the names of config keys

  • :type (String) — default: nil

    ensure values conform to the given type

Returns:

Raises:

  • (ArgumentError)

    if unsupported options are provided

  • (Git::FailedError)

    if git exits with a non-zero exit status



# File 'lib/git/commands/config_option_syntax/list.rb', line 59