Module git

Source
Expand description

Git operations for Xvc repositories

Functions§

build_gitignore
Returns xvc_walker::IgnoreRules for .gitignore It’s used to check whether a path is already ignored by Git.
exec_git
Run a git command with a specific git binary
get_absolute_git_command
Find the absolute path to the git executable to run TODO: This must be cached. It makes a which request every time a command runs
get_git_tracked_files
Get files tracked by git
git_auto_commit
Commit .xvc directory after Xvc operations
git_auto_stage
runs git add .xvc *.gitignore *.xvcignore to stage the files after Xvc operations
git_checkout_ref
Checkout a git branch or tag before running an Xvc command
git_ignored
Run git check-ignore to check if a path is ignored by Git
gix_list_branches
List local branches in a Git repository
gix_list_references
Return all tags and branches from a repository using Gix
handle_git_automation
This receives xvc_root ownership because as a final operation, it must drop the root to record the last entity counter before commit.
inside_git
Check whether a path is inside a Git repository. It returns None if not, otherwise returns the closest directory with .git. It works by checking .git directories in parents, until no more parent left.
stash_user_staged_files
Stash user’s staged files to avoid committing them before auto-commit
unstash_user_staged_files
Unstash user’s staged files after auto-commit