import nblite.git as this_modulegit
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',
]
unstaged_files = [fp for fp in fps if has_unstaged_changes(fp)]get_git_root
get_git_root()Get the root directory of the current git repository.
Returns: str: The path to the git root directory.
git_root_path = get_git_root()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.
unstaged_and_untracked_files = list_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',
]
staged_files = [fp for fp in fps if is_file_staged(fp)]get_unstaged_nb_twins
get_unstaged_nb_twins(root_path: str)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.
unstaged_twins = get_unstaged_nb_twins('../../test_proj')