This commit is contained in:
s41r4j
2025-09-10 12:15:36 +05:30
parent f9d979a54e
commit 9c2bd60cc5
5 changed files with 31 additions and 4 deletions
+2 -1
View File
@@ -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` |
@@ -301,4 +302,4 @@ MIT © [Your Name](https://github.com/yourusername)
*Made with ❤️ by developers who hate writing commit messages*
</div>
</div>
+26
View File
@@ -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 () => {
+2 -2
View File
@@ -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
View File
@@ -1,6 +1,6 @@
{
"name": "gims",
"version": "0.5.1",
"version": "0.5.2",
"description": "Git Made Simple AIpowered git helper using Gemini / OpenAI",
"author": "S41R4J",
"license": "MIT",
BIN
View File
Binary file not shown.