feat: change g a default behavior to --no-edit

- 'g a' now keeps original commit message by default (--no-edit)
- Added '--edit' flag to generate new AI commit message
- Simpler workflow for quick amendments
- Updated all documentation
- Bumped version to 0.6.5
This commit is contained in:
s41r4j
2025-10-20 10:18:44 +05:30
parent f2518b7db2
commit 260577f1f1
5 changed files with 26 additions and 11 deletions
+13
View File
@@ -1,5 +1,18 @@
# Changelog
## [0.6.5] - 2025-10-20
### 🔧 Command Behavior Updated
- **`g a` (amend) default behavior changed**: Now keeps the original commit message by default (`--no-edit`)
- **New `--edit` flag**: Use `g a --edit` to generate a new AI commit message
- **Simpler workflow**: `g a` simply merges current changes into previous commit without editing the message
### 📚 Documentation Updates
- Updated all documentation to reflect the new amend behavior
- Clarified that `g a` merges changes while keeping the original message
---
## [0.6.4] - 2025-10-19
### 🔧 Command Aliases Fixed
+3 -2
View File
@@ -11,7 +11,7 @@ g o # Online - AI commit + push
g ls # List - Short commit history
g ll # Large List - Detailed commit history
g h # History - Alias for list
g a # Amend - Smart amend with AI
g a # Amend - Merge changes into previous commit (keeps message)
g u # Undo - Undo last commit
```
@@ -55,7 +55,8 @@ g h # Same as g ls
```bash
g sg --multiple # Get 3 AI suggestions
g p # Preview before committing
g a # Smart amend with new AI message
g a # Amend: merge changes to previous commit (keeps message)
g a --edit # Amend with new AI-generated message
g sync --rebase # Smart sync with rebase
g stash # Stash with AI description
```
+1 -1
View File
@@ -36,7 +36,7 @@ g o # AI commit + push
| `g ls` | Commit history (short) |
| `g ll` | Commit history (detailed) |
| `g h` | Commit history (alias for ls) |
| `g a` | Smart amend |
| `g a` | Amend previous commit (keeps message) |
## 🤖 AI Models
+8 -7
View File
@@ -311,7 +311,7 @@ program.command('help-quick').alias('q')
console.log(` ${color.cyan('g ls')} List - Short commit history`);
console.log(` ${color.cyan('g ll')} Large List - Detailed commit history`);
console.log(` ${color.cyan('g h')} History - Alias for list`);
console.log(` ${color.cyan('g a')} Amend - Smart amend with AI`);
console.log(` ${color.cyan('g a')} Amend - Merge changes to previous commit (keeps message)`);
console.log(` ${color.cyan('g u')} Undo - Undo last commit\n`);
console.log(color.bold('Quick Setup:'));
@@ -701,8 +701,8 @@ program.command('stash')
});
program.command('amend').alias('a')
.description('Stage all changes and amend last commit')
.option('--no-edit', 'Keep existing commit message')
.description('Stage all changes and amend last commit (keeps message)')
.option('--edit', 'Generate new AI commit message')
.action(async (cmdOptions) => {
await ensureRepo();
try {
@@ -721,10 +721,7 @@ program.command('amend').alias('a')
return;
}
if (cmdOptions.noEdit) {
await git.raw(['commit', '--amend', '--no-edit']);
Progress.success('Amended last commit with staged changes');
} else {
if (cmdOptions.edit) {
// Generate new message for amend
Progress.start('🤖 Generating updated commit message');
const newMessage = await generateCommitMessage(rawDiff, getOpts());
@@ -732,6 +729,10 @@ program.command('amend').alias('a')
await git.raw(['commit', '--amend', '-m', newMessage]);
Progress.success(`Amended commit: "${newMessage}"`);
} else {
// Default: Keep existing message (--no-edit)
await git.raw(['commit', '--amend', '--no-edit']);
Progress.success('Amended last commit with staged changes (kept original message)');
}
} catch (e) {
handleError('Amend error', e);
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "gims",
"version": "0.6.4",
"version": "0.6.5",
"description": "Git Made Simple AIpowered git helper using Gemini / OpenAI",
"author": "S41R4J",
"license": "MIT",