Skip to content

feat(fetcher): add git_age for repository age from first commit - #165

Merged
unhappychoice merged 1 commit into
mainfrom
feat/git-age-fetcher
Apr 27, 2026
Merged

unhappychoice merged 1 commit into
mainfrom
feat/git-age-fetcher

Conversation

@unhappychoice

@unhappychoice unhappychoice commented Apr 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • New git_age fetcher: walks every commit reachable from HEAD and reports the calendar age from the oldest. All local, Safety::Safe.
  • Supports 10 shapes so the same fetcher can power text subtitles, structural breakdowns, charts, calendars, and timelines.
  • Picks up the open box for git_age in #63; intended subtitle for the project_codebase preset in #164.

Behaviour

Kind Safety Default shape
cached Safe text

Text formatting is switchable via format = "...":

format Output
(default) "duration" 2y 3m
"since" since 2024-01-15
"full" 2y 3m · since 2024-01-15

Other shapes:

  • TextBlock — 4 lines: Years: N / Months: N / Days: N / Since: YYYY-MM-DD
  • MarkdownTextBlock — **2y 3m 12d** since \2024-01-15``
  • LinkedTextBlock — duration + since on two unlinked rows (consumed by list_links)
  • Entries — years / months / days / first_commit_date
  • NumberSeries — [years, months, days]
  • Bars — three labelled bars: years / months / days
  • Calendar — month of the first commit with that day highlighted
  • Badge — tier label (fresh < 30d, young < 1y, mature < 5y, ancient ≥ 5y) + duration
  • Timeline — single First commit event

Empty repo (no commits): structural shapes emit empty bodies, Badge shows "no commits" (Status::Warn).

Compatible renderers

Shape Renderers
text text_plain, text_ascii, animated_typewriter, animated_postfx, animated_figlet_morph, animated_boot, animated_scanlines, animated_splitflap, animated_wave
text_block text_plain, list_plain, animated_*
markdown_text_block text_markdown
linked_text_block list_links
entries grid_table, animated_*
number_series chart_sparkline, chart_histogram, animated_*
bars chart_bar, chart_pie, list_ranking, animated_*
calendar grid_calendar, animated_*
badge status_badge, animated_*
timeline list_timeline, animated_*

Full reference (auto-generated after merge): https://splashboard.unhappychoice.com/reference/fetchers/git/git_age/

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test — 883 passed (16 new tests on git_age, including Age::between calendar arithmetic, format variants, per-shape body construction, badge tier thresholds, empty-repo behaviour)
  • cargo run --bin splashboard -- catalog fetcher git_age — lists 10 shapes and the compatible renderers above
  • Smoke-tested locally with a .splashboard/dashboard.toml exercising every shape (deleted before commit)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added Git repository age calculation that measures the duration from the first commit to the present, with multiple display formats including text summaries, calendars, badges, timeline events, and numeric visualizations.

Walks all commits reachable from HEAD and reports the calendar age from
the oldest. Supports 10 shapes: Text (with `format = "duration" |
"since" | "full"`), TextBlock, MarkdownTextBlock, LinkedTextBlock,
Entries, NumberSeries, Bars, Calendar (highlights first-commit day),
Badge (`fresh` / `young` / `mature` / `ancient` tier), and Timeline
(single "First commit" event).

Targets #164 (`project_codebase` preset subtitle) and ticks the open
box in #63.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Apr 27, 2026 •

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

A new Git fetcher (GitAge) has been added that calculates repository age from the first commit, computing calendar-aware durations and rendering results across multiple output formats including text, badges, timelines, and calendar views, with comprehensive unit tests.

Changes

Cohort / File(s) Summary
Git Age Fetcher Implementation
src/fetcher/git/age.rs
New 736-line implementation of GitAge fetcher that scans commits to extract first commit timestamp, calculates age in years/months/days, and renders across multiple Shape variants (text blocks, badges, calendars, timelines, bars) with unit tests for edge cases and formatting options.
Git Module Integration
src/fetcher/git/mod.rs
Adds age module declaration and includes GitAge in the fetchers() function to expose the new fetcher capability.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 A tale of first commits, so old and so deep,
Through Git's winding history, the rabbit did creep,
Found timestamps of origin, ages to measure,
Rendered in badges and calendars, what treasure!
Now every repo's first day gets its due,
History honored in formats both old and new. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.19% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding a new git_age fetcher that calculates repository age from the first commit.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 feat/git-age-fetcher

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 and usage tips.

@codecov

codecov Bot commented Apr 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.80675% with 49 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.06%. Comparing base (d9b5867) to head (5a885fa).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/fetcher/git/age.rs 90.78% 49 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #165      +/-   ##
==========================================
+ Coverage   77.76%   78.06%   +0.29%     
==========================================
  Files         122      123       +1     
  Lines       23045    23578     +533     
==========================================
+ Hits        17922    18407     +485     
- Misses       5123     5171      +48     
Files with missing lines Coverage Δ
src/fetcher/git/mod.rs 86.27% <100.00%> (+0.27%) ⬆️
src/fetcher/git/age.rs 90.78% <90.78%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@unhappychoice
unhappychoice merged commit 458928e into main Apr 27, 2026
7 checks passed
@unhappychoice
unhappychoice deleted the feat/git-age-fetcher branch April 27, 2026 01:17
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