# use-git
`use-git` is a `RustUse` facade crate for primitive `Git` vocabulary: object identifiers, refs, branches, tags, remotes, refspecs, revision selectors, pathspecs, ignore patterns, attributes, and status metadata.
It is not a `Git` client, repository engine, command runner, or storage implementation. It provides small, composable types that other crates can use when they need to talk about `Git` concepts without taking on a full `Git` dependency.
## What this crate provides
| `oid` | `use_git::oid` | `use-git-oid` | Object identifier and short object identifier primitives |
| `refs` | `use_git::refs` | `use-git-ref` | Ref names, ref kinds, symbolic refs, and `HEAD` vocabulary |
| `branch` | `use_git::branch` | `use-git-branch` | Local, remote-tracking, and default branch name primitives |
| `tag` | `use_git::tag` | `use-git-tag` | Tag names, tag kind vocabulary, and version-like tag wrappers |
| `remote` | `use_git::remote` | `use-git-remote` | Remote names, remote refs, and remote-tracking ref primitives |
| `refspec` | `use_git::refspec` | `use-git-refspec` | Fetch and push refspec syntax primitives |
| `revision` | `use_git::revision` | `use-git-revision` | Revision selectors, suffixes, and range vocabulary |
| `pathspec` | `use_git::pathspec` | `use-git-pathspec` | Pathspec patterns, magic labels, and scope vocabulary |
| `ignore` | `use_git::ignore` | `use-git-ignore` | Gitignore-style pattern and line classification vocabulary |
| `attribute` | `use_git::attribute` | `use-git-attribute` | Gitattributes pattern and attribute state vocabulary |
| `status` | `use_git::status` | `use-git-status` | Index, worktree, conflict, file-change, and porcelain status metadata |
## Installation
```toml
[dependencies]
use-git = "0.0.1"
```
Disable default features when you want a narrow facade surface:
```toml
[dependencies]
use-git = { version = "0.0.1", default-features = false, features = ["oid", "refs"] }
```
## Basic usage
```rust
#[cfg(all(feature = "oid", feature = "branch", feature = "refs"))]
{
use use_git::{GitBranchName, GitOid, GitRefName};
let oid: GitOid = "0123456789abcdef0123456789abcdef01234567"
.parse()
.expect("valid oid");
let branch = GitBranchName::new("feature/use-git").expect("valid branch");
let reference = GitRefName::new("refs/heads/main").expect("valid ref");
assert_eq!(oid.kind(), use_git::GitOidKind::Sha1);
assert!(branch.is_feature());
assert!(reference.is_branch());
}
```
## Scope
The facade only composes the focused vocabulary crates. It does not resolve, inspect, fetch, update, store, or compare repository data.
## Non-goals
- No `Git` command execution.
- No repository storage or object database access.
- No clone, fetch, pull, push, merge, rebase, checkout, or commit behavior.
- No packfile parsing.
- No history walking or diff computation.
- No dependency on `git2`, `gix`, `gitoxide`, or libgit2 bindings.