"""
Git attribution stripping tools.

This package provides functionality to remove Claude attribution from git commit
messages, including Co-Authored-By trailers and Generated-with signatures.

Key Functions:
    - strip_claude_attribution: Remove Claude attribution from a commit message
    - strip_attribution_from_commits: Rewrite commit history to remove attribution
    - create_backup_ref: Create backup ref before history rewrite
    - restore_from_backup: Restore branch from backup ref
    - list_backup_refs: List available backup refs
    - preview_changes: Preview what changes would be made

Usage Example:
    >>> from persuade.git_attribution import (
    ...     strip_attribution_from_commits,
    ...     restore_from_backup,
    ... )
    >>>
    >>> # Strip attribution from last 5 commits
    >>> result = strip_attribution_from_commits(
    ...     repo_path=Path("."),
    ...     commit_count=5,
    ...     preserve_human_coauthors=True,
    ... )
    >>> print(f"Rewrote {result.commits_rewritten} commits")
    >>> print(f"Backup ref: {result.backup_ref}")
    >>>
    >>> # Restore if needed
    >>> restore_from_backup(Path("."), result.backup_ref)

Security:
    - Uses subprocess with explicit command lists (no shell=True)
    - Creates backup refs before any history rewriting
    - Requires explicit confirmation for destructive operations
"""

# Re-export all public API for backwards compatibility
from .backup import (
    create_backup_ref,
    list_backup_refs,
    restore_from_backup,
)
from .core import (
    preview_changes,
    strip_attribution_from_commits,
    strip_claude_attribution,
)
from .types import (
    BACKUP_REF_PREFIX,
    CLAUDE_COAUTHOR_PATTERNS,
    GENERATED_WITH_PATTERNS,
    GIT_FILTER_BRANCH_TIMEOUT,
    GIT_REF_OPERATION_TIMEOUT,
    CommitInfo,
    StripResult,
)

__all__ = [
    # Core functions
    "strip_claude_attribution",
    "strip_attribution_from_commits",
    "preview_changes",
    # Backup functions
    "create_backup_ref",
    "list_backup_refs",
    "restore_from_backup",
    # Types
    "StripResult",
    "CommitInfo",
    # Constants
    "CLAUDE_COAUTHOR_PATTERNS",
    "GENERATED_WITH_PATTERNS",
    "BACKUP_REF_PREFIX",
    "GIT_REF_OPERATION_TIMEOUT",
    "GIT_FILTER_BRANCH_TIMEOUT",
]
