From 260577f1f1e82bee810996ba7781d4effc4b1854 Mon Sep 17 00:00:00 2001 From: s41r4j Date: Mon, 20 Oct 2025 10:18:44 +0530 Subject: [PATCH] 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 --- CHANGELOG.md | 13 +++++++++++++ QUICK_REFERENCE.md | 5 +++-- README.md | 2 +- bin/gims.js | 15 ++++++++------- package.json | 2 +- 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a08acc..4a31417 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/QUICK_REFERENCE.md b/QUICK_REFERENCE.md index 2757116..58dabe8 100644 --- a/QUICK_REFERENCE.md +++ b/QUICK_REFERENCE.md @@ -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 ``` diff --git a/README.md b/README.md index 02fbf5a..e434742 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/bin/gims.js b/bin/gims.js index 70db620..02f6f76 100755 --- a/bin/gims.js +++ b/bin/gims.js @@ -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); diff --git a/package.json b/package.json index 7608044..dace756 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gims", - "version": "0.6.4", + "version": "0.6.5", "description": "Git Made Simple – AI‑powered git helper using Gemini / OpenAI", "author": "S41R4J", "license": "MIT",