fix: madtea git commit display author comes from the Gitea account, can diverge from the actual local-identity author #447

Closed
opened 2026-08-17 23:18:02 +00:00 by hexajon · 1 comment
Owner

Follow-up surfaced while landing #425 (commit identity from the target repo's local config).

internal/cmd/git/commit.go populates its CommitData JSON author display field from the Gitea account (commitGetAuthor = GetGiteaAuthor). After #425, the actual commit is authored with the TARGET repo's local git identity. So the displayed author can diverge from who actually authored the commit.

Fix: source the displayed author from the same local-identity primitive (LocalIdentityAt), or read it back from the recorded commit object (HeadIdentity), so the display matches the commit that was actually written.

  • #425 - made the commit identity come from the target repo's local config.
Follow-up surfaced while landing #425 (commit identity from the target repo's local config). `internal/cmd/git/commit.go` populates its `CommitData` JSON `author` display field from the Gitea account (`commitGetAuthor = GetGiteaAuthor`). After #425, the actual commit is authored with the TARGET repo's local git identity. So the displayed `author` can diverge from who actually authored the commit. Fix: source the displayed author from the same local-identity primitive (`LocalIdentityAt`), or read it back from the recorded commit object (`HeadIdentity`), so the display matches the commit that was actually written. ## Related - #425 - made the commit identity come from the target repo's local config.
Author
Owner

Resolved on main by 0e6f8277 (the #425 item-1 commit, which landed after this was filed). That commit replaced commitGetAuthor = gitlib.GetGiteaAuthor with commitRecordedAuthor = func(...) { return gitlib.HeadIdentity("") } in internal/cmd/git/commit.go, and runCommit now reads the displayed author back from the recorded commit OBJECT (line 174), so the CLI's author field matches the local-identity author git actually wrote, not the Gitea account. The divergence this issue described is gone. Closing.

Resolved on main by 0e6f8277 (the #425 item-1 commit, which landed after this was filed). That commit replaced `commitGetAuthor = gitlib.GetGiteaAuthor` with `commitRecordedAuthor = func(...) { return gitlib.HeadIdentity("") }` in internal/cmd/git/commit.go, and runCommit now reads the displayed author back from the recorded commit OBJECT (line 174), so the CLI's `author` field matches the local-identity author git actually wrote, not the Gitea account. The divergence this issue described is gone. Closing.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sixfold-space/madtea#447
No description provided.