Skip to main content

Module rev_parse

Module rev_parse 

Source
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 at start.
expand_at_minus_to_branch_name
Expand an @{-N} token to the corresponding previous branch name.
is_inside_git_dir
Compute whether cwd is inside the repository’s git-dir.
is_inside_work_tree
Compute whether cwd is 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-prefix output.
symbolic_full_name
Resolve a symbolic ref name to its full form.
to_relative_path
Render path relative to cwd with / separators.