Skip to content

Commit c7b0967

Browse files
committed
fix: resolve duplicate debug logging and bump to v1.6.2
- Fixed duplicate "Debug mode enabled" message appearing twice - Removed redundant setup_logging() calls in CLI handlers - Streamlined logging initialization to main callback only - Updated README.md with smart grouping documentation - Bump version to 1.6.2
1 parent e10911e commit c7b0967

File tree

5 files changed

+101
-22
lines changed

5 files changed

+101
-22
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## [1.6.2] - 2025-08-21
4+
5+
### 🐛 Bug Fixes
6+
- **Fixed duplicate debug logging**: Removed redundant `setup_logging()` calls that caused "Debug mode enabled" to appear twice
7+
- **Cleaner CLI output**: Debug mode message now appears only once when using `-d/--debug` flag
8+
9+
### 🚀 Improvements
10+
- Streamlined logging initialization process
11+
- Better separation of concerns in CLI setup
12+
- Maintained all existing functionality with cleaner output
13+
314
## [1.6.1] - 2025-08-21
415

516
### 🐛 Bug Fixes

README.md

Lines changed: 86 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,16 @@ I built CommitLoom to solve these challenges by:
2828

2929
## 🚀 Quick Start
3030

31-
1. Install CommitLoom via pip:
31+
1. Install CommitLoom via pip or UV:
3232

3333
```bash
34+
# Using pip
3435
pip install commitloom
36+
37+
# Using UV (faster alternative)
38+
uv add commitloom
39+
# or for global installation
40+
uvx commitloom
3541
```
3642

3743
2. Set up your OpenAI API key:
@@ -58,14 +64,47 @@ loom -y # Non-interactive mode
5864
## ✨ Features
5965

6066
- 🤖 **AI-Powered Analysis**: Intelligently analyzes your changes and generates structured, semantic commit messages
61-
- 🧵 **Smart Batching**: Weaves multiple changes into coherent, logical commits
67+
- 🧠 **Smart File Grouping**: Advanced semantic analysis to group related files intelligently based on functionality, relationships, and change types
68+
- 🧵 **Smart Batching**: Weaves multiple changes into coherent, logical commits using intelligent grouping algorithms
6269
- 📊 **Complexity Analysis**: Identifies when commits are getting too large or complex
6370
- 🌿 **Branch Suggestions**: Offers to create a new branch for very large commits
6471
- 💰 **Cost Control**: Built-in token and cost estimation to keep API usage efficient
6572
- 📈 **Usage Metrics**: Track your usage, cost savings, and productivity gains with built-in metrics
6673
- 🔍 **Binary Support**: Special handling for binary files with size and type detection
74+
-**UV Support**: Compatible with UV package manager for faster dependency management
6775
- 🎨 **Beautiful CLI**: Rich, colorful interface with clear insights and warnings
6876

77+
## 🧠 Smart File Grouping
78+
79+
CommitLoom v1.6.0+ includes advanced semantic analysis for intelligent file grouping. Instead of simple directory-based batching, it now:
80+
81+
### How It Works
82+
- **Change Type Detection**: Automatically identifies the type of changes (features, fixes, tests, docs, refactoring, etc.)
83+
- **File Relationship Analysis**: Detects relationships between files:
84+
- Test files and their corresponding implementation files
85+
- Component files that work together (e.g., component + styles + tests)
86+
- Configuration files and their dependent modules
87+
- Documentation files and related code
88+
- **Semantic Grouping**: Groups files based on functionality rather than just directory structure
89+
- **Confidence Scoring**: Each grouping decision is scored for reliability
90+
91+
### Benefits
92+
- **Better Commit Organization**: Related changes are grouped together logically
93+
- **Cleaner History**: More meaningful commit messages that reflect actual feature boundaries
94+
- **Reduced Context Switching**: Files that belong together are committed together
95+
- **Intelligent Defaults**: Works automatically but can be disabled with `--no-smart-grouping`
96+
97+
### Example
98+
```bash
99+
# Before: Files grouped by directory
100+
Commit 1: src/components/Button.tsx, src/components/Input.tsx
101+
Commit 2: tests/Button.test.tsx, tests/Input.test.tsx
102+
103+
# After: Files grouped by functionality
104+
Commit 1: src/components/Button.tsx, tests/Button.test.tsx, docs/Button.md
105+
Commit 2: src/components/Input.tsx, tests/Input.test.tsx, docs/Input.md
106+
```
107+
69108
## 📖 Project History
70109

71110
CommitLoom evolved from my personal script that I was tired of copying across different projects. Its predecessor, GitMuse, was my experiment with local models like Llama through Ollama, but I couldn't achieve the consistent, high-quality results I needed. The rise of cost-effective OpenAI models, particularly gpt-4o-mini, made it possible for me to create a more reliable and powerful tool.
@@ -77,6 +116,15 @@ Key improvements over GitMuse:
77116
- Enhanced error handling and user experience
78117
- Improved binary file handling
79118

119+
### Recent Major Updates
120+
121+
**v1.6.0+ (2024)**: Introduced intelligent file grouping and performance improvements:
122+
- **Smart File Grouping**: Advanced semantic analysis for better commit organization
123+
- **UV Package Manager Support**: Migrated from Poetry to UV for 10-100x faster dependency management
124+
- **Enhanced CLI**: New `-s/--smart-grouping` and `--no-smart-grouping` options
125+
- **Improved Error Handling**: Better JSON parsing and metrics collection
126+
- **Performance Optimizations**: Reduced logging verbosity and duplicate messages
127+
80128
## ⚙️ Configuration
81129

82130
CommitLoom offers multiple ways to configure your API key and settings:
@@ -102,17 +150,26 @@ cl [command] [options]
102150

103151
- `-y, --yes`: Auto-confirm all prompts (non-interactive mode)
104152
- `-c, --combine`: Combine all changes into a single commit
153+
- `-s, --smart-grouping`: Enable intelligent file grouping (default: enabled)
154+
- `--no-smart-grouping`: Disable smart grouping and use simple batching
105155
- `-d, --debug`: Enable debug logging
156+
- `-m, --model`: Specify the AI model to use (e.g., gpt-4.1-mini)
106157

107158
#### Usage Examples
108159

109160
```bash
110-
# Basic usage (interactive mode)
161+
# Basic usage (interactive mode with smart grouping)
111162
loom
112163

113164
# Non-interactive mode with combined commits
114165
loom -y -c
115166

167+
# Use smart grouping with specific model
168+
loom -s -m gpt-4.1
169+
170+
# Disable smart grouping for simple batching
171+
loom --no-smart-grouping
172+
116173
# View usage statistics
117174
loom stats
118175

@@ -209,14 +266,14 @@ While local models like Llama are impressive, my experience with GitMuse showed
209266

210267
### How much will it cost to use CommitLoom?
211268

212-
With the default gpt-4o-mini model, costs are very low:
213-
- Input: $0.15 per million tokens
214-
- Output: $0.60 per million tokens
269+
With the default gpt-4.1-mini model, costs are very low:
270+
- Input: $0.40 per million tokens
271+
- Output: $1.60 per million tokens
215272

216273
For perspective, a typical commit analysis:
217274
- Uses ~1,000-2,000 tokens
218-
- Costs less than $0.002 (0.2 cents)
219-
- That's about 500 commits for $1
275+
- Costs less than $0.004 (0.4 cents)
276+
- That's about 250 commits for $1
220277

221278
This makes it one of the most cost-effective tools in its category, especially when compared to the time saved and quality of commit messages generated.
222279

@@ -250,20 +307,34 @@ For detailed documentation on the metrics system, see the [Usage Metrics Documen
250307

251308
CommitLoom automatically:
252309
1. Analyzes the size and complexity of changes
253-
2. Warns about potentially oversized commits
254-
3. Suggests splitting changes when appropriate
255-
4. Maintains context across split commits
256-
5. Optionally creates a new branch when commits are very large
310+
2. Uses smart grouping to organize related files together
311+
3. Warns about potentially oversized commits
312+
4. Suggests splitting changes when appropriate
313+
5. Maintains context across split commits
314+
6. Optionally creates a new branch when commits are very large
315+
316+
### What is smart grouping and how does it work?
317+
318+
Smart grouping is CommitLoom's advanced semantic analysis feature that intelligently organizes your changed files:
319+
320+
- **Detects relationships**: Groups test files with their implementation files, components with their styles, etc.
321+
- **Understands change types**: Identifies whether changes are features, fixes, documentation, tests, or refactoring
322+
- **Semantic analysis**: Goes beyond directory structure to understand what files actually work together
323+
- **Automatic by default**: Enabled automatically in v1.6.0+, but can be disabled with `--no-smart-grouping`
324+
325+
This results in more logical commits where related files are grouped together, making your git history cleaner and more meaningful.
257326

258327
## 🛠️ Development Status
259328

260-
-**CI/CD**: Automated testing, linting, and publishing
329+
-**CI/CD**: Automated testing, linting, and publishing with GitHub Actions
330+
-**Package Management**: Migrated to UV for faster dependency resolution and builds
261331
-**Code Quality**:
262332
- Ruff for linting and formatting
263333
- MyPy for static type checking
264-
- 70%+ test coverage
334+
- 70%+ test coverage with pytest
335+
-**Smart Features**: Advanced semantic analysis and intelligent file grouping
265336
-**Distribution**: Available on PyPI and GitHub Releases
266-
-**Documentation**: Comprehensive README and type hints
337+
-**Documentation**: Comprehensive README with feature examples and type hints
267338
-**Maintenance**: Actively maintained and accepting contributions
268339

269340
## 🤝 Contributing

commitloom/__main__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ def commit(ctx, yes: bool, combine: bool, debug: bool, smart_grouping: bool, mod
7171
# Use debug from either local flag or global context
7272
debug = debug or ctx.obj.get("DEBUG", False)
7373

74-
if debug:
75-
console.setup_logging(debug=True)
74+
# Logging is already configured in the main callback
7675

7776
try:
7877
test_mode = "pytest" in sys.modules
@@ -109,8 +108,7 @@ def stats(ctx) -> None:
109108
try:
110109
# Create a CommitLoom instance and run the stats command
111110
loom = CommitLoom(test_mode=True) # Test mode to avoid API key requirement
112-
if debug:
113-
console.setup_logging(debug=True)
111+
# Logging is already configured in the main callback
114112
loom.stats_command()
115113
except (KeyboardInterrupt, Exception) as e:
116114
handle_error(e)

commitloom/cli/cli_handler.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,7 @@ def stats_command(self) -> None:
443443

444444
def run(self, auto_commit: bool = False, combine_commits: bool = False, debug: bool = False) -> None:
445445
"""Run the commit process."""
446-
if debug:
447-
self.console.setup_logging(debug)
446+
# Logging is already configured in the main CLI callback
448447

449448
# Set auto-confirm mode based on auto_commit flag
450449
console.set_auto_confirm(auto_commit)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "commitloom"
3-
version = "1.6.1"
3+
version = "1.6.2"
44
description = "Weave perfect git commits with AI-powered intelligence"
55
authors = [
66
{ name = "Petru Arakiss", email = "petruarakiss@gmail.com" }

0 commit comments

Comments
 (0)