repomatic.mailmap moduleΒΆ
Group the contributor identities of the git history into a .mailmap.
Backs the sync-mailmap command: parses the existing mappings as the
reference for identities already grouped, reads every author and committer the
history holds, and appends whatever is not covered yet.
- repomatic.mailmap.MAILMAP_PATH = PosixPath('.mailmap')ΒΆ
Canonical path to the
.mailmapfile in the repository root.
- repomatic.mailmap.remove_header(content)[source]ΒΆ
Return content without the generated-by comment header and blank lines above.
Strips the metadata block
sync-mailmapwrites at the top of the file (generated_headeroutput:# Generated by β¦and# Timestamp: β¦lines), so a re-run parses only the identity mappings.- Return type:
- class repomatic.mailmap.Record(canonical='', aliases=<factory>, pre_comment='')[source]ΒΆ
Bases:
objectA mailmap identity mapping entry.
- class repomatic.mailmap.Mailmap[source]ΒΆ
Bases:
objectHelpers to manipulate
.mailmapfiles..mailmapfile format is documented on Git website.Initialize the mailmap with an empty list of records.
- parse(content)[source]ΒΆ
Parse mailmap content and add it to the current list of records.
Each non-empty, non-comment line is considered a mapping entry.
The preceding lines of a mapping entry are kept attached to it as pre-comments, so the layout will be preserved on rendering, during which records are sorted.
- Return type:
- property git_contributors: set[str][source]ΒΆ
Returns the set of all contributors found in the Git commit history.
No normalization happens: all variations of authors and committers strings attached to all commits are considered. A failing git invocation raises through the CLI framework, which prints gitβs stderr and exits non-zero without a property ever terminating the process itself.