0.5.2
This commit is contained in:
@@ -109,6 +109,7 @@ g o
|
||||
| `gims online` | `g o` | AI commit + push (use `--set-upstream` on first push) | `g o --set-upstream` |
|
||||
| `gims commit <message...>` | `g m` | Commit with a custom message (no AI) | `g m "fix: handle empty input"` |
|
||||
| `gims pull` | `g p` | Pull latest changes | `g p` |
|
||||
| `gims amend` | `g a` | Stage all changes and amend the last commit (reuse message) | `g a` |
|
||||
| `gims list` | `g ls` | Show numbered commit history | `g ls` |
|
||||
| `gims largelist` | `g ll` | Detailed commit history | `g ll` |
|
||||
| `gims branch <n>` | `g b` | Branch from commit #n | `g b 3 feature-x` |
|
||||
|
||||
+26
@@ -542,6 +542,32 @@ program.command('pull').alias('p')
|
||||
catch (e) { handleError('Pull error', e); }
|
||||
});
|
||||
|
||||
program.command('amend').alias('a')
|
||||
.description('Stage all changes and amend last commit (no message edit)')
|
||||
.action(async () => {
|
||||
await ensureRepo();
|
||||
try {
|
||||
const { all } = await safeLog();
|
||||
if (!all || all.length === 0) {
|
||||
console.log('No commits to amend. Make an initial commit first.');
|
||||
return;
|
||||
}
|
||||
|
||||
await git.add('.');
|
||||
|
||||
const rawDiff = await git.diff(['--cached', '--no-ext-diff']);
|
||||
if (!rawDiff.trim()) {
|
||||
console.log('No staged changes to amend.');
|
||||
return;
|
||||
}
|
||||
|
||||
await git.raw(['commit', '--amend', '--no-edit']);
|
||||
console.log('Amended last commit with staged changes.');
|
||||
} catch (e) {
|
||||
handleError('Amend error', e);
|
||||
}
|
||||
});
|
||||
|
||||
program.command('list').alias('ls')
|
||||
.description('Short numbered git log (oldest → newest)')
|
||||
.action(async () => {
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "gims",
|
||||
"version": "0.4.3",
|
||||
"version": "0.5.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "gims",
|
||||
"version": "0.4.3",
|
||||
"version": "0.5.2",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@google/genai": "^1.5.1",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gims",
|
||||
"version": "0.5.1",
|
||||
"version": "0.5.2",
|
||||
"description": "Git Made Simple – AI‑powered git helper using Gemini / OpenAI",
|
||||
"author": "S41R4J",
|
||||
"license": "MIT",
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user