Skip to main content

Module git

Module git 

Source
Expand description

Git commit, history, and change-detection helpers.

Structs§

ChangedFile
A file that changed between git tree states.
HistoryEntry
A single entry from git log for a wiki page.

Functions§

changed_since_commit
Detect changed .md files under wiki/ between a past commit and HEAD.
changed_wiki_files
Detect changed .md files under wiki/ in the working tree vs HEAD.
collect_changed_files
Collect all changed .md files by merging two git diffs:
commit
Stage all files and commit. Returns empty string if nothing to commit.
commit_paths
Stage specific paths and commit. Returns empty string if nothing to commit.
current_head
Get current HEAD commit hash. Returns None if repo has no commits.
init_repo
Initialise a new git repository at path.
page_history
Return git commit history for a file path relative to repo root. Uses git log (shell) for simplicity and built-in --follow support.