Skip to content

fix: use committer timezone for nisse.jgit.date - #193

Merged
gnodet merged 1 commit into
mainfrom
fix/commit-date-timezone
Aug 25, 2026
Merged

gnodet merged 1 commit into
mainfrom
fix/commit-date-timezone

Conversation

@gnodet

@gnodet gnodet commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Fix formatCommitDate() to use committer timezone (getCommitterIdent().getTimeZone()) instead of author timezone (getAuthorIdent().getTimeZone())
  • The method already uses the committer timestamp via getCommitTime(), so the timezone should also come from the committer for consistency
  • This matters for rebased/cherry-picked commits where author and committer differ, and makes the iso8601-offset format an exact match for git's %cI (committer date ISO 8601)

Test plan

  • All existing date format tests pass (default, iso8601, iso8601-offset, custom, invalid-fallback)
  • Full ./mvnw clean install -B passes (all modules including integration tests and Gradle plugin)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Commit dates now display using the committer’s timezone, improving timestamp accuracy.

formatCommitDate() was using the committer's timestamp
(getCommitTime()) but the author's timezone
(getAuthorIdent().getTimeZone()), creating an accidental hybrid.
For rebased or cherry-picked commits where author and committer
differ, this produced incorrect date output.

Use getCommitterIdent().getTimeZone() so both timestamp and
timezone consistently come from the committer. This also makes
the iso8601-offset format (%cI) an exact match for git's
committer date, which is important for projects using
nisse.properties with export-subst for reproducible builds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5c782fea-4df8-4414-b883-5eb2306b7021

📥 Commits

Reviewing files that changed from the base of the PR and between 7ea9f8d and 04c227b.

📒 Files selected for processing (1)
  • sources/jgit-source/src/main/java/eu/maveniverse/maven/nisse/source/jgit/JGitPropertySource.java

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The JGit property source now formats commit dates using the committer’s timezone instead of the author’s timezone.

Changes

Commit date formatting

Layer / File(s) Summary
Use committer timezone for dates
sources/jgit-source/src/main/java/eu/maveniverse/maven/nisse/source/jgit/JGitPropertySource.java
formatCommitDate now uses the committer’s timezone when constructing the formatted commit date.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 04c22

This localized change aligns the formatted timezone with the committer timestamp and is merge-ready after normal checks; no actionable merge-blocking risk remains.

Suggested reviewers: cstamas

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: using the committer timezone for nisse.jgit.date.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/commit-date-timezone

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gnodet
gnodet marked this pull request as ready for review August 25, 2026 06:20
@gnodet gnodet added the bug Something isn't working label Aug 25, 2026
@gnodet
gnodet merged commit c496b6f into main Aug 25, 2026
17 checks passed
@gnodet
gnodet deleted the fix/commit-date-timezone branch August 25, 2026 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant