Skip to content

Add --reverse flag to history command#225

Merged
esmuellert merged 2 commits intoesmuellert:mainfrom
fredrikaverpil:feat/history-reverse
Feb 5, 2026
Merged

Add --reverse flag to history command#225
esmuellert merged 2 commits intoesmuellert:mainfrom
fredrikaverpil:feat/history-reverse

Conversation

@fredrikaverpil
Copy link
Contributor

@fredrikaverpil fredrikaverpil commented Feb 4, 2026

Why?

When reviewing commit history, it's often useful to see commits in chronological order (oldest first) rather than reverse chronological order. This is particularly helpful when:

  • Following the development story from beginning to end
  • Reviewing PR changes in the order they were made
  • Understanding how a feature evolved over time

This also mimics the order in which how GitHub presents per-commit review.

What?

  • Add --reverse (and -r short form) flag to :CodeDiff history command
  • Create reusable flag parser in lua/codediff/core/args.lua for extensibility
  • Add tab completion support for flags
  • Add unit tests
  • Update documentation with usage examples
  • Maintain full backward compatibility

Notes

The git layer already supported opts.reverse - this PR exposes that functionality through a command interface. The flag parser architecture makes it easy to add future flags (e.g., --author, --since) to any command.

Add --reverse (and -r) flag to :CodeDiff history command to show
commits in chronological order (oldest first) instead of reverse
chronological.

- Create reusable flag parser in lua/codediff/core/args.lua
- Add flag completion support for --reverse and -r
- Update documentation with usage examples
- Add comprehensive unit tests (9/9 passing)
- Maintain backward compatibility
@esmuellert esmuellert enabled auto-merge February 5, 2026 01:12
@esmuellert
Copy link
Owner

Thanks, I added the dynamic test file detection so we don't need to manually add new spec files every time, and bump the version before merge it

@esmuellert esmuellert force-pushed the feat/history-reverse branch from f1569cb to a913be8 Compare February 5, 2026 01:13
Replace hardcoded SPEC_FILES array with find-based auto-discovery to ensure new test files are automatically included in the test runner.
@esmuellert esmuellert force-pushed the feat/history-reverse branch from a913be8 to fd4ba1b Compare February 5, 2026 01:13
@esmuellert esmuellert merged commit ef0111c into esmuellert:main Feb 5, 2026
13 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