Skip to content

Add create_with_author to Ledger trait #10

@jdc-pub

Description

@jdc-pub

The Ledger::create method currently uses self.signature() (the repo's git config) for both author and committer with no way to override them. For import use cases — e.g. syncing issues from GitHub into a local forge store — it's necessary to preserve original authorship and timestamp on the resulting commit.

Proposed API

fn create_with_author(
    &self,
    ref_prefix: &str,
    strategy: &IdStrategy<'_>,
    fields: &[(&str, &[u8])],
    message: &str,
    author: &git2::Signature<'_>,
) -> Result<LedgerEntry, Error>;

The committer would remain self.signature() (the local identity); only the author would be overridden.

Motivation

When importing GitHub issues, authorship should be attributed to the original author:

  • name: user.login
  • email: <login>@users.noreply.github.com
  • time: created_at from the GitHub payload

Without this, all imported commits appear authored by whoever ran the import.

Assisted-by: Claude Code (Claude Sonnet 4.6)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions