read_git_commit_timestamp_for_file

documenteer.sphinxconfig.utils.read_git_commit_timestamp_for_file(filepath, repo_path=None)

Obtain the timestamp for the most recent commit to a given file in a Git repository.

Parameters
filepathstr

Repository-relative path for a file.

repo_pathstr, optional

Path to the Git repository. Leave as None to use the current working directory.

Returns
commit_timestampdatetime.datetime

The datetime of a the most recent commit to the given file.

Raises
IOError

Raised if the filepath does not exist in the Git repository.