Skip to content

Use SOURCE_DATE_EPOCH for the man page date - #101

Merged
andrew merged 1 commit into
mainfrom
man-source-date-epoch
Nov 29, 2026
Merged

andrew merged 1 commit into
mainfrom
man-source-date-epoch

Conversation

@andrew

@andrew andrew commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

The man page generator stamped time.Now() into every page header, so two builds of the same source produced different man pages. It now reads SOURCE_DATE_EPOCH when set and falls back to the current time otherwise. The date is always UTC so it does not vary with the build machine's timezone, and a non-numeric value is an error.

Same change as git-pkgs/git-pkgs#421.

Summary by CodeRabbit

  • Documentation
    • Generated manual pages now display dates in UTC, keeping them consistent across time zones. Builds can use a supplied timestamp to produce stable dates; invalid timestamp values stop generation with an error rather than producing pages with an unintended date.

Makes the generated man pages reproducible. The date is always UTC so it does not vary with the build machine's timezone.
@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The man-page generator now uses UTC for its header date. It uses SOURCE_DATE_EPOCH when set, and reports an error if the value cannot be parsed. Tests cover the timestamp, error, and default-time cases.

Changes: Man-page date generation

Layer / File(s) Summary
UTC date selection and validation
scripts/generate-man/main.go, scripts/generate-man/main_test.go
buildDate parses SOURCE_DATE_EPOCH as a base-10 Unix timestamp, or returns the current time in UTC when it is unset. main uses this date and exits on error. Tests cover the timestamp, invalid input, and default behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Merge Risk: Minimal · up to bbb07

The man-page generator now uses UTC dates and honors SOURCE_DATE_EPOCH, so builds from the same source can produce consistent page dates. Invalid values fail loudly. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the man page date now comes from SOURCE_DATE_EPOCH. The raw summary confirms the generator reads SOURCE_DATE_EPOCH to set the header date in UTC, and the objectives de…
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.
Full details: Title check

Explanation

The title names the main change: the man page date now comes from SOURCE_DATE_EPOCH. The raw summary confirms the generator reads SOURCE_DATE_EPOCH to set the header date in UTC, and the objectives describe the same change. The title is specific and matches the changeset.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cc05cdf5-114b-4297-a61c-b550a4e028ca
Commits

Reviewing files that changed from the base of the PR and between e6bbb73 and bbb07c0.

Files selected for processing: 2

  • scripts/generate-man/main.go
  • scripts/generate-man/main_test.go

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

@andrew
andrew merged commit d8059c7 into main Nov 29, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant