# `Git.Commands.Shortlog`
[🔗](https://github.com/joshrotenberg/git_wrapper_ex/blob/main/lib/git/commands/shortlog.ex#L1)

Implements the `Git.Command` behaviour for `git shortlog`.

Summarizes `git log` output grouped by author. Supports summary mode
(count only), numbered sorting, email display, and ref ranges.

# `t`

```elixir
@type t() :: %Git.Commands.Shortlog{
  all: boolean(),
  email: boolean(),
  group: String.t() | nil,
  max_count: non_neg_integer() | nil,
  numbered: boolean(),
  ref: String.t() | nil,
  since: String.t() | nil,
  summary: boolean(),
  until_date: String.t() | nil
}
```

# `args`

```elixir
@spec args(t()) :: [String.t()]
```

Returns the argument list for `git shortlog`.

## Examples

    iex> Git.Commands.Shortlog.args(%Git.Commands.Shortlog{})
    ["shortlog"]

    iex> Git.Commands.Shortlog.args(%Git.Commands.Shortlog{summary: true, numbered: true})
    ["shortlog", "-s", "-n"]

    iex> Git.Commands.Shortlog.args(%Git.Commands.Shortlog{email: true, ref: "v1.0..HEAD"})
    ["shortlog", "-e", "v1.0..HEAD"]

    iex> Git.Commands.Shortlog.args(%Git.Commands.Shortlog{max_count: 10, group: "author"})
    ["shortlog", "--max-count=10", "--group=author"]

# `parse_output`

```elixir
@spec parse_output(String.t(), non_neg_integer()) ::
  {:ok, [Git.ShortlogEntry.t()]} | {:error, {String.t(), non_neg_integer()}}
```

Parses the output of `git shortlog`.

When summary mode is detected (tab-separated count and author), uses
`ShortlogEntry.parse_summary/1`. Otherwise uses `ShortlogEntry.parse_full/1`.

Returns `{:ok, [%Git.ShortlogEntry{}]}` on success or
`{:error, {stdout, exit_code}}` on failure.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
