import nblite.git as this_module
git
has_unstaged_changes
has_unstaged_changes(file_path)
Check if the given file has unstaged changes.
Arguments: - file_path
(str): The path to the file to check.
Returns: bool: True if there are unstaged changes, False otherwise.
= [
fps '../../test_proj/nbs/notebook1.ipynb',
'../../test_proj/nbs/notebook2.ipynb',
'../../test_proj/nbs/submodule/notebook3.ipyÂnb',
]= [fp for fp in fps if has_unstaged_changes(fp)] unstaged_files
get_git_root
get_git_root()
Get the root directory of the current git repository.
Returns: str: The path to the git root directory.
= get_git_root() git_root_path
list_staged_files
list_staged_files()
List all currently staged files.
Returns: list: A list of staged file paths.
show_doc(this_module.list_unstaged_and_untracked_files)
list_unstaged_and_untracked_files
list_unstaged_and_untracked_files()
List all currently unstaged and untracked files.
Returns: list: A list of unstaged and untracked file paths.
list_unstaged_and_untracked_files
list_unstaged_and_untracked_files()
List all currently unstaged and untracked files.
Returns: list: A list of unstaged and untracked file paths.
= list_unstaged_and_untracked_files() unstaged_and_untracked_files
is_file_staged
is_file_staged(file_path)
Check if the given file is staged.
Arguments: - file_path
(str): The path to the file to check.
Returns: bool: True if the file is staged, False otherwise.
= [
fps '../../test_proj/nbs/notebook1.ipynb',
'../../test_proj/nbs/notebook2.ipynb',
'../../test_proj/nbs/submodule/notebook3.ipynb',
]
= [fp for fp in fps if is_file_staged(fp)] staged_files
get_unstaged_nb_twins
str) get_unstaged_nb_twins(root_path:
Get all notebook twins for which at least one is unstaged.
Returns: list: A list of dictionaries, each containing ‘staged’ and ‘unstaged’ lists of twin paths.
= get_unstaged_nb_twins('../../test_proj') unstaged_twins