phystool.physgit

Module Contents

Classes

GitFile

GitPDBFile

GitTexFile

GitExtraFile

PhysGit

Functions

run_git_in_terminal

Data

logger

API

phystool.physgit.logger

“getLogger(…)”

exception phystool.physgit.PhysGitError

Bases: Exception

class phystool.physgit.GitFile(status: Status, path: pathlib.Path)

Bases: abc.ABC

SUFFIXES: list[str]

None

IN_DIR: pathlib.Path

None

class Status

Bases: enum.StrEnum

MODIFIED

“M”

MODIFIED_SUBMODULE

“m”

ADDED

“A”

ADDED_AND_MODIFIED

“AM”

DELETED

“D”

RENAMED

“R”

COPIED

“C”

UNTRACKED

“??”

IGNORED

“!!”

classmethod create(status: Status, path: pathlib.Path) phystool.physgit.GitFile
abstractmethod add(path: pathlib.Path) None
message() str
get_files() list[str]
get_diff() str
display_diff() None
class phystool.physgit.GitPDBFile(status: Status, path: pathlib.Path)

Bases: phystool.physgit.GitFile

SUFFIXES

[“.tex”, “.json”, “.py”, “.pyx”]

add(path: pathlib.Path) None
class phystool.physgit.GitTexFile(status: Status, path: pathlib.Path)

Bases: phystool.physgit.GitFile

SUFFIXES

[“.sty”, “.cls”]

add(path: pathlib.Path) None
class phystool.physgit.GitExtraFile(status: Status, path: pathlib.Path)

Bases: phystool.physgit.GitFile

SUFFIXES

[“.conf”]

FILES

[“0_physdb.conf”, “.gitignore”]

add(path: pathlib.Path) None
class phystool.physgit.PhysGit

Initialization

Helper class to manage PDBFile stored in config.DB_DIR. If the directory is not a valid git repository it raises InvalidGitRepositoryError.

To have a nicer git diff experience, this helper class uses bat and delta (named git-delta in debian package manager).

interactive_staging() None
stage(git_pdb_file: phystool.physgit.GitFile) None
commit(for_terminal: bool) str
get_remote_url() str
phystool.physgit.run_git_in_terminal() None