@andrebuzeli/git-mcp 15.11.6 → 15.11.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/tools/git-update.js +25 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@andrebuzeli/git-mcp",
|
|
3
|
-
"version": "15.11.
|
|
3
|
+
"version": "15.11.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "MCP server para Git com operações locais e sincronização paralela GitHub/Gitea",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,4 +26,4 @@
|
|
|
26
26
|
"archiver": "^7.0.0",
|
|
27
27
|
"axios": "^1.7.7"
|
|
28
28
|
}
|
|
29
|
-
}
|
|
29
|
+
}
|
package/src/tools/git-update.js
CHANGED
|
@@ -108,6 +108,28 @@ Retorna um resumo de todas as operações realizadas: status, add, commit e push
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
// OPTIMIZATION: If user requested all files ["."], try to be specific to avoid timeout
|
|
112
|
+
// Windows CMD limit is ~8191 chars. We treat < 6000 as safe.
|
|
113
|
+
let filesToAdd = files;
|
|
114
|
+
if (files.length === 1 && files[0] === ".") {
|
|
115
|
+
const allChangedFiles = [
|
|
116
|
+
...(status.modified || []),
|
|
117
|
+
...(status.created || []),
|
|
118
|
+
...(status.deleted || []),
|
|
119
|
+
...(status.not_added || [])
|
|
120
|
+
];
|
|
121
|
+
|
|
122
|
+
// Calculate command line length roughly
|
|
123
|
+
const totalLength = allChangedFiles.join(" ").length;
|
|
124
|
+
|
|
125
|
+
if (totalLength < 6000 && allChangedFiles.length > 0) {
|
|
126
|
+
filesToAdd = allChangedFiles;
|
|
127
|
+
console.error(`[git-update] Optimization: Adding ${allChangedFiles.length} specific files instead of '.' (len: ${totalLength})`);
|
|
128
|
+
} else {
|
|
129
|
+
console.error(`[git-update] Optimization skipped: Too many changes (${totalLength} chars), falling back to '.'`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
111
133
|
// Dry run mode - return preview
|
|
112
134
|
if (dryRun) {
|
|
113
135
|
return asToolResult({
|
|
@@ -116,7 +138,7 @@ Retorna um resumo de todas as operações realizadas: status, add, commit e push
|
|
|
116
138
|
message: "DRY RUN: Operações que seriam executadas",
|
|
117
139
|
operations,
|
|
118
140
|
preview: {
|
|
119
|
-
add:
|
|
141
|
+
add: filesToAdd,
|
|
120
142
|
commit: message,
|
|
121
143
|
push: { force, remotes: ["github", "gitea"] }
|
|
122
144
|
}
|
|
@@ -124,8 +146,8 @@ Retorna um resumo de todas as operações realizadas: status, add, commit e push
|
|
|
124
146
|
}
|
|
125
147
|
|
|
126
148
|
// Step 2: Add
|
|
127
|
-
await git.add(projectPath,
|
|
128
|
-
operations.add = { files, success: true };
|
|
149
|
+
await git.add(projectPath, filesToAdd);
|
|
150
|
+
operations.add = { files: filesToAdd, success: true };
|
|
129
151
|
|
|
130
152
|
// Step 3: Commit
|
|
131
153
|
const sha = await git.commit(projectPath, message);
|