Implements the Git.Command behaviour for git name-rev.
Finds a symbolic name for a given commit. With :name_only the output is
just the name; otherwise git prints the input followed by the name. With
:tags only tags are used to name the commit.
Summary
Types
Functions
Returns the argument list for git name-rev.
Examples
iex> Git.Commands.NameRev.args(%Git.Commands.NameRev{commit: "HEAD"})
["name-rev", "HEAD"]
iex> Git.Commands.NameRev.args(%Git.Commands.NameRev{commit: "HEAD", name_only: true})
["name-rev", "--name-only", "HEAD"]
iex> Git.Commands.NameRev.args(%Git.Commands.NameRev{commit: "HEAD", name_only: true, tags: true})
["name-rev", "--name-only", "--tags", "HEAD"]
@spec parse_output(String.t(), non_neg_integer()) :: {:ok, String.t()} | {:error, {String.t(), non_neg_integer()}}
Parses the output of git name-rev.
On success, returns {:ok, name} with the trimmed output string. On a
non-zero exit code, returns {:error, {stdout, exit_code}}.