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

One-call repository introspection helpers that compose lower-level `Git` functions.

Provides convenient summaries of repository state, HEAD information, and
remote details without requiring multiple manual calls.

All functions accept an optional keyword list. Use `:config` to specify the
repository via a `Git.Config` struct; when omitted a default config is built
from the environment.

# `dirty?`

```elixir
@spec dirty?(keyword()) :: {:ok, boolean()} | {:error, term()}
```

Returns whether the repository has any uncommitted changes.

Checks for staged, modified, or untracked files.

## Options

  * `:config` - a `Git.Config` struct

## Examples

    {:ok, false} = Git.Info.dirty?()

# `head`

```elixir
@spec head(keyword()) :: {:ok, map()} | {:error, term()}
```

Returns current HEAD information.

Includes the branch name, full SHA, and whether HEAD is detached.

## Options

  * `:config` - a `Git.Config` struct

## Examples

    {:ok, head} = Git.Info.head()
    head.branch   #=> "main"
    head.detached #=> false

# `remotes_detailed`

```elixir
@spec remotes_detailed(keyword()) ::
  {:ok, [%{name: String.t(), fetch_url: String.t(), push_url: String.t()}]}
  | {:error, term()}
```

Returns enriched remote information.

Lists all remotes with their fetch and push URLs via `git remote -v`.

## Options

  * `:config` - a `Git.Config` struct

## Examples

    {:ok, remotes} = Git.Info.remotes_detailed()
    hd(remotes).name       #=> "origin"
    hd(remotes).fetch_url  #=> "https://github.com/owner/repo.git"

# `root`

```elixir
@spec root(keyword()) :: {:ok, String.t()} | {:error, term()}
```

Returns the repository root path.

Wraps `git rev-parse --show-toplevel`.

## Options

  * `:config` - a `Git.Config` struct

## Examples

    {:ok, "/home/user/project"} = Git.Info.root()

# `summary`

```elixir
@spec summary(keyword()) :: {:ok, map()} | {:error, term()}
```

Returns a comprehensive repository overview.

Composes status, rev-parse, remote, and log to produce a single map
describing the current state of the repository.

## Options

  * `:config` - a `Git.Config` struct

## Examples

    {:ok, info} = Git.Info.summary()
    info.branch    #=> "main"
    info.dirty     #=> false
    info.ahead     #=> 0

---

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