colrev.git_repo.GitRepo
- class colrev.git_repo.GitRepo(path)[source]
Bases:
objectWrapper for Git repository interactions.
Initialize the instance.
Methods
add_changesAdd changed file to git.
add_setting_changesAdd changes in settings to git.
behind_remoteCheck whether the repository is behind the remote.
create_commitCreate a commit (including a commit report).
file_in_historyCheck whether a file is in the git history.
get_commit_messageGet the commit message for commit #.
get_last_commit_dateGet the last commit date for a file.
get_last_commit_shaGet the last commit sha.
get_last_updatedReturns the date of the last update (if available) in YYYY-MM-DD format.
get_remote_urlGet the remote url.
get_tree_hashGet the current tree hash.
get_untracked_filesGet the files that are untracked by git.
has_changesCheck whether the relative path (or the git repository) has changes.
has_record_changesCheck whether the records have changes.
has_untracked_search_recordsCheck whether there are untracked search records.
pull_if_repo_cleanPull project if repository is clean.
records_changedCheck whether the records were changed.
remote_aheadCheck whether the remote is ahead.
repo_initializedCheck whether the repository is initialized.
stash_unstaged_changesStash unstaged changes.
update_gitignoreUpdate the gitignore file by adding or removing particular paths.
- add_changes(path, *, remove=False, ignore_missing=False)[source]
Add changed file to git.
- Return type:
None
- create_commit(*, msg, review_manager, manual_author=False, script_call='', saved_args=None, skip_status_yaml=False, skip_hooks=True)[source]
Create a commit (including a commit report).
- Return type:
bool
- get_last_updated(feed_file)[source]
Returns the date of the last update (if available) in YYYY-MM-DD format.
- Return type:
str
- has_changes(relative_path, *, change_type='all')[source]
Check whether the relative path (or the git repository) has changes.
- Return type:
bool
- has_record_changes(*, change_type='all')[source]
Check whether the records have changes.
- Return type:
bool