Skip to content

feat: accept human-friendly duration formats in prune --older-than#24

Merged
captainsafia merged 3 commits intomainfrom
copilot/update-prune-command-human-friendly
Dec 21, 2025
Merged

feat: accept human-friendly duration formats in prune --older-than#24
captainsafia merged 3 commits intomainfrom
copilot/update-prune-command-human-friendly

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 21, 2025

The prune --older-than option required ISO 8601 duration format (e.g., P30D, P1Y), which is unintuitive for most users.

Changes

Added normalizeDuration() utility

  • Converts human-friendly formats (30d, 2w, 6M, 1y) to ISO 8601 before parsing
  • Case-sensitive: uppercase M = months, lowercase m = minutes
  • Pass-through for existing ISO 8601 inputs (backward compatible)

Updated parseDuration()

  • Now accepts both human-friendly and ISO 8601 formats
  • Updated error messages to reflect new formats

Command usage

# All now valid:
grove prune --older-than 30d
grove prune --older-than 6M
grove prune --older-than 1y
grove prune --older-than P30D  # ISO 8601 still works

Supported units: d (days), w (weeks), M (months), y (years), h (hours), m (minutes), s (seconds)

Includes 35 new tests covering normalization, parsing, and edge cases.

Original prompt

Update the prune command to accept human friendly values for 'older-than' that normalize to ISO 8601 format.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits December 21, 2025 17:20
Co-authored-by: captainsafia <1857993+captainsafia@users.noreply.github.com>
Co-authored-by: captainsafia <1857993+captainsafia@users.noreply.github.com>
Copilot AI changed the title [WIP] Update prune command to accept human friendly values for older-than feat: accept human-friendly duration formats in prune --older-than Dec 21, 2025
Copilot AI requested a review from captainsafia December 21, 2025 17:26
@github-actions
Copy link
Copy Markdown

🌳 Grove PR Build Ready!

Version: 0.0.0-pr.24.56b2a4c

Install with:

curl -fsSL https://safia.rocks/grove/install.sh | sh -s -- --pr 24

Or if you already have grove installed:

grove self-update --pr 24

Or download directly from Actions Artifacts

Available binaries:

  • grove-linux-x64
  • grove-linux-arm64
  • grove-darwin-x64
  • grove-darwin-arm64

@captainsafia captainsafia marked this pull request as ready for review December 21, 2025 19:30
@captainsafia captainsafia merged commit 60e744a into main Dec 21, 2025
5 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.

2 participants