Authoring Module Reference
The authoring module controls how commit author information is handled.
Functions
Section titled “Functions”authoring.pass_thru
Section titled “authoring.pass_thru”Preserve original author when possible:
authoring.pass_thru( default = "Bot <bot@example.com>", # Fallback author)authoring.overwrite
Section titled “authoring.overwrite”Replace all authors:
authoring.overwrite( "Bot <bot@example.com>", # Author for all commits)authoring.allowed
Section titled “authoring.allowed”Allow specific authors, default for others:
authoring.allowed( default = "Bot <bot@example.com>", # Fallback author allowlist = [ # Preserved authors "alice@example.com", "bob@example.com", ],)Author Format
Section titled “Author Format”Authors use Git standard format:
Name <email@example.com>Examples
Section titled “Examples”Open Source Export
Section titled “Open Source Export”authoring = authoring.pass_thru( default = "Open Source Bot <oss@company.com>",)Bot-Only Commits
Section titled “Bot-Only Commits”authoring = authoring.overwrite( "Sync Bot <sync@company.com>",)Allow Internal Team
Section titled “Allow Internal Team”authoring = authoring.allowed( default = "External <external@company.com>", allowlist = [ "*@company.com", ],)Allowlist Patterns
Section titled “Allowlist Patterns”The allowlist parameter supports glob-style patterns:
| Pattern | Matches |
|---|---|
alice@example.com | Exact email match |
*@company.com | Any email at company.com |
*@*.company.com | Any subdomain email |
Behavior Details
Section titled “Behavior Details”What Happens When Author Doesn’t Match
Section titled “What Happens When Author Doesn’t Match”When using authoring.allowed and an author isn’t in the allowlist:
- Commit is attributed to the
defaultauthor - Original author is preserved in the commit message body (configurable)
- The transformation continues normally
Malformed Authors
Section titled “Malformed Authors”If the source commit has a malformed author (missing email, empty name), Copybara uses the default author.
Author vs Committer
Section titled “Author vs Committer”Git distinguishes between author (who wrote the code) and committer (who applied it). Copybara’s authoring module affects the author field. The committer is typically the user/bot running Copybara.
Common Use Cases
Section titled “Common Use Cases”| Use Case | Authoring Mode |
|---|---|
| Open source export (preserve contributors) | pass_thru |
| Automated sync (bot attribution) | overwrite |
| Internal → External (allow known devs) | allowed |
| Mirror (exact copy) | pass_thru |