Skip to main content

Module git

Module git 

Source
Expand description

Language-agnostic git utilities.

Provides shared git operations used across all language crates:

  • File reading from git refs (read_git_file)
  • File diffing between refs (git_diff_file)
  • Ref name sanitization (sanitize_ref_name)
  • Worktree path computation (worktree_path_for)
  • RAII worktree management (WorktreeGuard)

These utilities were consolidated from duplicate implementations in crates/ts/ and crates/java/. Language crates should use these directly (or compose with WorktreeGuard) rather than reimplementing git plumbing.

Structs§

DeprecationCommit
A commit that added files to a deprecated component directory.
WorktreeGuard
RAII guard for a temporary git worktree.

Functions§

commit_co_changed_families
Find component families whose source files were modified in the given commit.
find_deprecation_commits
Find commits between from_ref and to_ref that added files to deprecated/components/ directories (i.e., commits that deprecated a component).
git_diff_file
Get the diff of a single file between two refs via git diff <from>..<to> -- <path>.
read_git_file
Read a file from a git ref via git show <ref>:<path>.
sanitize_ref_name
Sanitize a git ref name for use as a directory name.
worktree_dir_for
Return the parent directory for all worktrees of a given repo.
worktree_path_for
Generate a deterministic worktree path for a given ref.