Skip to content

fix: use author date, not committer date, for a commit's identity date - #2

Merged
Mearman merged 1 commit into
mainfrom
fix/author-date-not-committer-date
Sep 8, 2026
Merged

Mearman merged 1 commit into
mainfrom
fix/author-date-not-committer-date

Conversation

@Mearman

@Mearman Mearman commented Sep 8, 2026

Copy link
Copy Markdown
Member

getHeadCommit() read HEAD's date with git log --format=%cI, the committer date. Every consumer of BuildIdentity.date treats it as when the commit was authored, but committer date changes whenever a commit is rebased onto a new position, even though its content and authorship never change. Any repo that rebase-merges its PRs ends up displaying a date that drifts from the commit's real author date, sometimes by tens of minutes.

Switches to %aI (author date) instead, which stays fixed across a rebase. Adds a test that amends a commit's committer date in isolation (the same effect a rebase has) and asserts the reported date still matches the original author date.

  • typecheck, lint, test all pass locally
  • new regression test covers author-date-vs-committer-date divergence directly

getHeadCommit() read HEAD's date with `git log --format=%cI`, the committer date.
Every consumer of BuildIdentity.date treats it as when the commit was authored,
but committer date changes whenever a commit is rebased onto a new position,
even though its content and authorship never change.
Any repo that rebase-merges its PRs -- the normal case -- ends up displaying
a date that drifts from the commit's real author date, sometimes by tens of minutes.

Switch to `%aI` (author date) instead, which stays fixed across a rebase.
Add a test that amends a commit's committer date in isolation (the same effect
a rebase has) and asserts the reported date still matches the original author date,
so a regression back to committer date would be caught.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-08T05:34:04.414305Z fd8a084 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Mearman
Mearman merged commit 5c54a99 into main Sep 8, 2026
4 checks passed
@Mearman
Mearman deleted the fix/author-date-not-committer-date branch September 8, 2026 05:31
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant