Expand description
Revision parsing and repository discovery helpers for rev-parse.
This module implements a focused subset of Git’s revision parser used by
grit rev-parse in v2 scope: repository/work-tree discovery flags, basic
object-name resolution, and lightweight peeling (^{}, ^{object},
^{commit}).
Functions§
- abbreviate_
object_ id - Abbreviate an object ID to a unique prefix.
- abbreviate_
ref_ name - Abbreviate a full ref name to its shortest unambiguous form.
- discover_
optional - Return
Some(repo)when a repository can be discovered atstart. - expand_
at_ minus_ to_ branch_ name - Expand an
@{-N}token to the corresponding previous branch name. - is_
inside_ git_ dir - Compute whether
cwdis inside the repository’s git-dir. - is_
inside_ work_ tree - Compute whether
cwdis inside the repository’s work tree. - list_
loose_ abbrev_ matches - Public: find all object IDs whose hex prefix matches the given string.
- resolve_
at_ minus_ to_ oid - Resolve
@{-N}to the commit OID it points to. - resolve_
revision - Resolve a revision string to an object ID.
- show_
prefix - Compute the
--show-prefixoutput. - symbolic_
full_ name - Resolve a symbolic ref name to its full form.
- to_
relative_ path - Render
pathrelative tocwdwith/separators.