autocommit.setup

Functions

add_commit_hook(repo, *[, hook_name])

Adds the commit hook to the repository

add_key_to_tree(key, worktree)

Adds the api key to the worktree

add_storage_dir_to_exclude(gitdir)

Add .autocommit_storage_dir/ to the .git/info/exclude file

check_repo_bare(repo)

Checks if the repo is bare

get_repo_worktree(repo[, worktree])

Gets the repo and worktree paths

remove_commit_hook(repo, *[, hook_name])

Removes the commit hook from the repository

run_cleanup(repo[, worktree])

Cleans up the autocommit setup

run_setup(repo, isolation[, key, worktree, ...])

Runs the setup for the repository

autocommit.setup.add_storage_dir_to_exclude(gitdir: Path)[source]

Add .autocommit_storage_dir/ to the .git/info/exclude file

unless it is already there. This serves to avoid tracking the storage directory, which contains the api key.

autocommit.setup.add_key_to_tree(key, worktree)[source]

Adds the api key to the worktree

autocommit.setup.check_repo_bare(repo: Path)[source]

Checks if the repo is bare

autocommit.setup.add_commit_hook(repo: Path, *, hook_name='prepare-commit-msg', hook_content)[source]

Adds the commit hook to the repository

autocommit.setup.remove_commit_hook(repo: Path, *, hook_name='prepare-commit-msg', hook_content)[source]

Removes the commit hook from the repository

autocommit.setup.get_repo_worktree(repo: Path, worktree: Path | None = None)[source]

Gets the repo and worktree paths

autocommit.setup.run_setup(repo, isolation: bool, key=None, worktree: Path | None = None, enable_rag: bool = True, enable_function_calls: bool = False)[source]

Runs the setup for the repository

autocommit.setup.run_cleanup(repo: Path, worktree: Path | None = None)[source]

Cleans up the autocommit setup