Skip to content

feat: Add group_by parameter for grouping revisions#7

Merged
SilverRainZ merged 1 commit into
masterfrom
feat/group-by
Jun 18, 2026
Merged

feat: Add group_by parameter for grouping revisions#7
SilverRainZ merged 1 commit into
masterfrom
feat/group-by

Conversation

@SilverRainZ

Copy link
Copy Markdown
Member

Summary

  • Add group_by parameter to load_extra('recentupdate') for grouping revisions by time period
  • Add recentupdate_group_by config value with ENUM constraint (day/month/year)
  • Implement get_time_period_key, compact_revision, group_revisions functions
  • Grouping is by UTC time period and author
  • Messages are merged in chronological order
  • Files are merged with deduplication (priority: removed > added > changed)

Changes

  • src/sphinxnotes/recentupdate/__init__.py: Add grouping logic and config value
  • docs/usage.rst: Document group_by parameter and add example
  • docs/conf.rst: Document recentupdate_group_by config value
  • tests/test_group_revisions.py: Add unit tests for new functions

Co-authored-by: MiMoCode mimo@xiaomi.com

Add group_by parameter to load_extra('recentupdate') and
recentupdate_group_by config value (ENUM: day/month/year) for
grouping revisions by UTC time period and author.

Key changes:
- Refactor get_git_revisions to yield revisions as an Iterator
- Add streaming group logic: groups are built incrementally and
  compacted only when count is reached, ensuring exact count output
- Files merged with dedup, priority: removed > added > changed
- Messages merged in chronological order (oldest first)

Co-authored-by: MiMoCode <mimo@xiaomi.com>
@SilverRainZ SilverRainZ merged commit c2e344c into master Jun 18, 2026
2 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