Open
Conversation
Add comprehensive specification for new CLI export functionality: - Individual commit export with --show <sha> - Commit range export with --range <base> <target> - Depth-based export with --range <target> --depth N - Unified --out flag for all headless commands - Automatic output directory creation - Progress reporting and error handling - Quality checklist with validation criteria
Add detailed technical specification and planning documents: - CLI flag contracts and interface definitions - Data model for commit export functionality - Implementation plan with task breakdown - Quickstart guide with usage examples - Technical research with key design decisions - Dulwich integration strategy for SHA resolution and range walking
Add comprehensive task breakdown for CLI export feature: - 18 detailed implementation tasks grouped by user story - Phase-based approach with setup, foundational, and story-specific tasks - Parallel execution opportunities and dependency mapping - MVP-first strategy with incremental delivery - All tasks target single-file architecture (app.py only) - No new dependencies required, uses existing Dulwich capabilities
Complete implementation of CLI export features: - Add --show flag for single commit export with metadata and diff - Add --range flag for commit range export with progress reporting - Add unified --out flag for all headless modes - Update CLI.md with new flags and usage examples - Complete all 18 implementation tasks across 3 user stories - Support Dulwich-based SHA resolution and range walking - Maintain backward compatibility for existing --compare/--pr modes
- Replace hardcoded branch name with placeholder in README installation instructions - Add _resolve_sha() helper function using git rev-parse for robust SHA resolution - Update git configuration to use transient -c flags for partial clone support - Improve error handling and timeout for git operations - Use full SHA resolution consistently across --show and --range commands
Replace hardcoded branch name with placeholder <branch-name> in installation instructions to make documentation more maintainable and applicable to any branch.
- Replace Rich console output with native git log --graph for better performance - Add optional out_dir parameter to _export for file output support - Implement smart output directory resolution: * --export with --out → write timestamped file to specified folder * --export without --out → colored output to stdout (existing behavior) * All other modes without --out → default to /tmp - Update all headless functions to use unified out_dir parameter - Maintain backward compatibility for existing --export behavior
- Replace Rich console rendering with native git log --graph - Add support for both colored stdout and file output - Implement proper filename generation for export files - Update argument handling for flexible output modes - Maintain backward compatibility for existing --export behavior
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description
Summary
This PR extends
cexwith headless CLI export capabilities, reducing reliance on the TUI for inspecting and archiving commit history. All changes are confined toapp.py(single-file architecture) with no new dependencies.New flags
--show <sha>— Export full details of a single commit (metadata, file stats, unified diff) to a.txtfile. Accepts short or full SHAs.--range <base> <target>— Export all commits in a linear ancestry range (git log base..target), one.txtfile per commit withExporting N/total…progress on stderr. Also supports--range <sha> --depth Nto export the last N ancestors.--out <path>— Unified output folder flag for all headless modes (--show,--range,--compare,--pr). Defaults to/tmp, created automatically if missing.--export --out <path>— Extended existing--exportto optionally write the commit graph to a plain-text file (usesgit log --graphdirectly) instead of printing to stdout.Output filename format
Commit export files follow:
<YYYYMMDD>_<short-sha>_<slug>.txtExample:
20260404_f291787_add-safety-guardrails-to-claude-md.txtTechnical highlights
_resolve_sha()— usesgit rev-parseto resolve short or full SHAs robustly_slugify()— stdlib-only slug generator for filenames_write_commit_export()— writes commit header + diff summary + changed files + full unified diff; uses transient-c extensions.partialclone=originflags sogit showlazy-fetches blobs from the promisor remote without modifying the repo config (which would break Dulwich)_write_export()— gainedout_dirparam (default".") so--compareand--pralso respect--out_export()— simplified to rungit log --graphdirectly via subprocess;--color=alwaysfor stdout,--no-colorfor fileTest plan
uv run cex locchh/commit-explorer --show <sha> --out /tmp— verify.txtfile created with metadata and full diffuv run cex locchh/commit-explorer --range <base> <target> --out /tmp— verify one file per commit, progress on stderruv run cex locchh/commit-explorer --range <sha> --depth 5 --out /tmp— verify 5 files exporteduv run cex locchh/commit-explorer --show 0000000— verify non-zero exit and error on stderruv run cex locchh/commit-explorer --export --out .— verify plain-text graph file writtenuv run cex locchh/commit-explorer --export— verify coloured graph still prints to stdoutuv run cex locchh/commit-explorer --compare master <branch>— verify report still written (no regression)