Skip to content

feat: add .cmtignore support for excluding files from LLM analysis#29

Merged
clifton merged 2 commits intomainfrom
cmt-ignore
Feb 17, 2026
Merged

feat: add .cmtignore support for excluding files from LLM analysis#29
clifton merged 2 commits intomainfrom
cmt-ignore

Conversation

@clifton
Copy link
Copy Markdown
Owner

@clifton clifton commented Feb 17, 2026

Summary

  • Adds .cmtignore file support (glob patterns) to permanently exclude files from commit message generation, useful for large generated files like migrations and schemas
  • Introduces max_file_lines threshold (default 5000) that detects oversized files and prompts users to add them to .cmtignore
  • Improves staged files display with aligned columns and dimmed ~ markers for skipped/ignored files
  • Files in .cmtignore are still committed normally — only skipped for LLM analysis

Test plan

  • All 78 existing tests pass
  • New tests for .cmtignore pattern matching (exact, single glob, double glob)
  • New tests for load_cmtignore / append_to_cmtignore file operations
  • New tests for max_file_lines threshold filtering and zero-disables behavior
  • New test for cmtignore pattern integration in get_staged_changes
  • Clippy clean
  • Manual test: create .cmtignore in a repo and verify files are excluded from LLM diff
  • Manual test: stage a file exceeding 5000 lines and verify the interactive prompt

🤖 Generated with Claude Code

clifton and others added 2 commits February 17, 2026 10:53
Large generated files (migrations, schemas, etc.) can overwhelm the LLM
context window. This adds a .cmtignore file (glob patterns) to permanently
exclude files from commit message generation, plus a max_file_lines
threshold (default 5000) that prompts users to add oversized files.

Files in .cmtignore are still committed normally — they're only skipped
for LLM analysis. Skipped/ignored files display dimmed with a ~ marker
in the staged files summary.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update indentation and line breaks in src/git.rs and src/cmtignore.rs
- Improve readability of test assertions and complex format! macros
- Ensure consistent code style across the project
@clifton clifton merged commit 4756240 into main Feb 17, 2026
3 checks passed
@clifton clifton deleted the cmt-ignore branch February 17, 2026 16:58
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