Skip to main content

Module git_ops

Module git_ops 

Source
Expand description

Git operations for distributed AIDA.

Provides wrappers around git commands for:

  • Node registration CAS (compare-and-swap) loop
  • Committing object changes
  • Push/pull synchronization

These operations shell out to the git CLI rather than using libgit2, keeping the dependency light and behavior identical to what users see when they run git manually.

Structs§

GitResult
Result of a git command execution.

Functions§

add
Stage specific files.
add_all
Stage all changes (tracked and untracked) in a subdirectory.
commit
Commit staged changes.
configure_user
Configure user name and email for commits (repo-local, not global).
create_store_worktree
Create an orphan branch and worktree for the AIDA store.
current_branch
Get the current branch name.
git_config_get
Get a git config value (checks local, then global).
has_changes
Check if the working tree has uncommitted changes.
has_worktree
Check if a worktree exists for the given directory.
head_sha
Get the current HEAD commit SHA (short form).
init
Initialize a new git repository.
is_git_repo
Check if a directory is a git repository.
is_remote_reachable
Check if the remote is reachable (can we push/pull?).
merge_gate
Commit and push all pending object changes in the aida repo. This is the “sync” operation — called when the user wants to share changes. Run the merge gate: assign agreed IDs to all objects that don’t have one.
pull
Pull (merge) from remote.
pull_rebase
Pull with rebase from remote.
push
Push to the remote. Returns true on success, false if rejected (non-fast-forward).
register_node
Register a new node in the aida registry via git CAS push loop.
remove_store_worktree
Remove a store worktree and optionally delete the branch.
sync_objects