cueloop 0.5.0

A Rust CLI for managing AI agent loops with a structured JSON task queue
Documentation
//! Git operations module.
//!
//! Purpose:
//! - Git operations module.
//!
//! Responsibilities:
//! - Provide focused implementation or regression coverage for this file's owning feature.
//!
//! Scope:
//! - Limited to this file's owning feature boundary.
//!
//! This module provides a comprehensive set of git operations for CueLoop,
//! organized into focused submodules:
//!
//! - `error`: Error types and classification
//! - `status`: Status parsing and path tracking
//! - `lfs`: Git LFS detection and validation
//! - `commit`: Commit and push operations
//! - `clean`: Repository cleanliness validation
//!
//! # Invariants
//! - All operations use `-c core.fsmonitor=false` to avoid fsmonitor issues
//! - Error types are Send + Sync for anyhow compatibility
//! - LFS operations gracefully handle repositories without LFS
//!
//! # What this does NOT handle
//! - General file system operations (use std::fs or anyhow)
//! - Non-git version control systems
//!
//! Usage:
//! - Used through the crate module tree or integration test harness.

pub mod branch;
pub mod clean;
pub mod commit;
pub mod error;
pub(crate) mod github_cli;
pub mod issue;
pub mod lfs;
pub mod pr;
pub mod status;
pub mod workspace;

// Re-export commonly used items for convenience within the crate.
pub(crate) use branch::current_branch;
pub use clean::{
    CUELOOP_QUEUE_ONLY_ALLOWED_PATHS, CUELOOP_RUN_CLEAN_ALLOWED_PATHS, DirtyPathBaseline,
    capture_dirty_path_baseline_ignoring_paths, repo_dirty_only_allowed_paths,
    require_clean_repo_ignoring_paths, require_no_unexpected_dirty_paths_since_baseline,
};
pub use commit::{
    abort_rebase, add_paths_force, commit_all, fetch_branch, is_ahead_of_upstream,
    is_behind_upstream, list_conflict_files, push_current_branch, push_head_to_branch,
    push_upstream, push_upstream_allow_create, push_upstream_with_rebase, rebase_onto,
    restore_tracked_paths_to_head, revert_uncommitted, upstream_ref,
};
pub use error::GitError;
pub(crate) use issue::{
    GITHUB_ISSUE_SYNC_HASH_KEY, compute_issue_sync_hash, create_issue, edit_issue,
    normalize_issue_metadata_list, parse_issue_number,
};
pub use lfs::{check_lfs_health, filter_modified_lfs_files, has_lfs, list_lfs_files};
// PR-related functions kept for potential non-parallel use, but unused in direct-push mode
#[allow(unused_imports)]
pub(crate) use pr::{
    MergeState, PrInfo, PrLifecycle, check_gh_available, create_pr, merge_pr, pr_lifecycle_status,
    pr_merge_status,
};
pub use status::{
    ensure_paths_unchanged, ignored_paths, is_path_ignored, is_path_tracked, snapshot_paths,
    status_paths, status_porcelain,
};
// NEW: workspace-based isolation (clone workspaces).
pub(crate) use workspace::{
    WorkspaceSpec, create_workspace_at, origin_urls, remove_workspace, workspace_root,
};