# `Git.Tag`
[🔗](https://github.com/joshrotenberg/git_wrapper_ex/blob/main/lib/git/tag.ex#L1)

Parsed representation of a git tag.

Contains the tag name, whether it is annotated, the tagger name and email
(for annotated tags), the date, and the annotation message.

# `t`

```elixir
@type t() :: %Git.Tag{
  annotated: boolean(),
  date: String.t() | nil,
  message: String.t() | nil,
  name: String.t(),
  tagger_email: String.t() | nil,
  tagger_name: String.t() | nil
}
```

# `format_string`

```elixir
@spec format_string() :: String.t()
```

Returns the `--format` string used by `git tag -l` for detailed output.

Uses ASCII control characters as delimiters for reliable parsing.

# `parse_detailed`

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

Parses the output of `git tag -l --format=...` with the detailed format string.

## Examples

    iex> Git.Tag.parse_detailed("")
    []

# `parse_list`

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

Parses the output of `git tag -l -n1` into a list of `Git.Tag` structs.

Each line has the form:

    v1.0.0          first release
    v1.1.0          second release

Tags with an annotation message are marked as annotated. Lightweight tags
have no message in `-n1` output (or the message matches the commit subject).

## Examples

    iex> Git.Tag.parse_list("v1.0.0\nv1.1.0\n")
    [%Git.Tag{name: "v1.0.0", annotated: false}, %Git.Tag{name: "v1.1.0", annotated: false}]

---

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