You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you stage many files, `lazycommit` can automatically split your changes into logical groups and create multiple commits with proper Conventional Commit messages.
136
-
137
-
- Auto-trigger: when staged files ≥ 5, or when the diff is large
- Deep split: if everything falls into one big bucket (e.g., `app/api/*`), it auto-splits by second-level directory (like `analytics`, `projects`, `sessions`)
140
-
- Token-safe AI: each group uses a compact `git diff --cached --numstat` summary (not full diffs) to generate the commit line
141
-
142
-
Usage:
143
-
144
-
```sh
145
-
# Just run as usual; grouping triggers automatically when applicable
146
-
lazycommit
147
-
148
-
# Force grouping even for < 5 files
149
-
lazycommit --split
150
-
```
151
-
152
129
#### Handling large diffs
153
130
154
-
For large commits with many files, lazycommit automatically stays within API limits and maintains clean history:
131
+
For large commits with many files, lazycommit automatically stays within API limits and generates relevant commit messages:
155
132
156
-
-**Automatic detection**: Large diffs and many-file changes are detected
157
-
-**Logical grouping**: Files are grouped into conventional buckets; single huge buckets are auto-split by second-level directory (e.g., `app/api/<group>/...`)
158
-
-**Token-safe summaries**: Each group sends a small `--numstat` summary to AI instead of full diffs
159
-
-**Sequential commits**: In multi-commit mode, groups are committed one-by-one with their own messages
133
+
-**Smart summarization**: Uses `git diff --cached --numstat` to create compact summaries of all changes
134
+
-**Context snippets**: Includes truncated diff snippets from top changed files for better context
135
+
-**Token-safe processing**: Keeps prompts small while maintaining accuracy for 20+ file changes
136
+
-**Single commit**: Always generates one commit message, no matter how many files are staged
137
+
-**Enhanced analysis**: Uses improved prompts and smart truncation for better commit message quality
160
138
161
139
### Git hook
162
140
@@ -290,10 +268,10 @@ lazycommit config set timeout=20000 # 20s
290
268
291
269
The maximum character length of the generated commit message.
292
270
293
-
Default: `50`
271
+
Default: `100`
294
272
295
273
```sh
296
-
lazycommit config set max-length=100
274
+
lazycommit config set max-length=150
297
275
```
298
276
299
277
#### type
@@ -323,13 +301,14 @@ The tool uses Groq's fast inference API to provide quick and accurate commit mes
323
301
324
302
For large commits that exceed API token limits, lazycommit automatically:
325
303
326
-
1.**Detects large/many-file diffs** and switches to a scalable flow
327
-
2.**Groups files** by conventional type/scope; if only one large bucket remains, **auto-splits by second-level directory** (e.g., `app/api/<group>/...`)
328
-
3.**Generates messages per group** using compact `git diff --cached --numstat` summaries (not full diffs)
329
-
4.**Commits sequentially** per group with clear, conventional messages
330
-
5. When a single commit is requested, **uses compact summaries** to generate conventional messages efficiently
304
+
1.**Detects large/many-file diffs** and switches to enhanced analysis mode
305
+
2.**Creates compact summaries** using `git diff --cached --numstat` to capture all changes efficiently
306
+
3.**Includes context snippets** from the most changed files to provide semantic context
307
+
4.**Generates a single commit message** that accurately reflects all changes without hitting API limits
308
+
5.**Smart truncation** preserves sentence structure and meaning when messages approach length limits
309
+
6.**Enhanced prompts** provide better context for AI to generate complete, professional commit messages
331
310
332
-
This ensures you can commit large changes (like new features, refactoring, or initial project setup) without hitting API limits, while keeping a clean history.
311
+
This ensures you can commit large changes (like new features, refactoring, or initial project setup) without hitting API limits, while maintaining accuracy, relevance, and high-quality commit messages.
333
312
334
313
## Troubleshooting
335
314
@@ -365,7 +344,7 @@ If you get a 413 error, your diff is too large for the API. Try these solutions:
365
344
366
345
-**Use the GPT-OSS-20B model** (default): `lazycommit config set model "openai/gpt-oss-20b"`
0 commit comments