class Git::Commands::ShowRef::List

Standard ref listing command via ‘git show-ref`

Lists refs stored in the local repository together with their associated commit IDs. When no filters are given, all refs are listed. Filters can narrow output to heads, tags, or refs matching a given pattern.

An exit status of 1 is not an error — it indicates that no matching refs were found. Exit status 0 means at least one match was found.

For strict per-ref verification, use {Git::Commands::ShowRef::Verify}. For stdin-based filtering, use {Git::Commands::ShowRef::ExcludeExisting}. For a simple boolean existence check (git >= 2.43), use {Git::Commands::ShowRef::Exists}.

@example List all refs

cmd = Git::Commands::ShowRef::List.new(execution_context)
result = cmd.call
result.stdout  # => "abc1234 refs/heads/main\n..."

@example List only tags

cmd = Git::Commands::ShowRef::List.new(execution_context)
result = cmd.call(tags: true)

@example List with abbreviated SHA hashes

cmd = Git::Commands::ShowRef::List.new(execution_context)
result = cmd.call(hash: 7)

@example Match a pattern

cmd = Git::Commands::ShowRef::List.new(execution_context)
result = cmd.call('v1.0', 'v2.0', tags: true)

@note ‘arguments` block audited against git-scm.com/docs/git-show-ref/2.53.0

@see Git::Commands::ShowRef

@see git-scm.com/docs/git-show-ref

@api private