gityo 1.0.4 → 1.0.6
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/dist/index.js +6 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -197973,25 +197973,19 @@ async function mainController(options = {}) {
|
|
|
197973
197973
|
let finalCommitMessage = options.message?.trim() ?? "";
|
|
197974
197974
|
if (typeof options.message === "string" && finalCommitMessage.length === 0) throw new Error("Provided commit message cannot be empty.");
|
|
197975
197975
|
const files = await getChangedFiles(git);
|
|
197976
|
-
if (files.length === 0)
|
|
197977
|
-
console.log("No changed files found.");
|
|
197978
|
-
return;
|
|
197979
|
-
}
|
|
197980
|
-
const branchSummary = await git.branch();
|
|
197981
|
-
const branch = branchSummary.detached ? "(detached HEAD)" : branchSummary.current;
|
|
197982
|
-
console.log(`${source_default.cyan(" Branch:")} ${source_default.reset.bold(branch)}`);
|
|
197976
|
+
if (files.length === 0) return console.log("No changed files found.");
|
|
197983
197977
|
const { diff, hasStaged } = await getCommitDiff(git);
|
|
197984
197978
|
if (finalCommitMessage.length > 0) {
|
|
197985
|
-
console.log(source_default.yellow
|
|
197986
|
-
console.log(source_default.
|
|
197979
|
+
console.log(source_default.yellow("✓ Using direct commit message"));
|
|
197980
|
+
console.log(source_default.cyan.dim(finalCommitMessage));
|
|
197987
197981
|
console.log("");
|
|
197988
197982
|
}
|
|
197989
197983
|
if (finalCommitMessage.length === 0 && !forceLLMGenerate) finalCommitMessage = await promptForCommitMessageInput(modelConfig.model);
|
|
197990
197984
|
if (finalCommitMessage.length === 0) while (true) {
|
|
197991
|
-
if (forceLLMGenerate) console.log(source_default.yellow
|
|
197985
|
+
if (forceLLMGenerate) console.log(source_default.yellow("• Using LLM to generate message"));
|
|
197992
197986
|
finalCommitMessage = (await runWithLoading("Generating commit message", () => generateCommitMessage(languageModel, config$4.instructions ?? null, diff))).text.trim();
|
|
197993
197987
|
if (finalCommitMessage.length === 0) throw new Error("The selected model returned an empty commit message.");
|
|
197994
|
-
console.log(source_default.
|
|
197988
|
+
console.log(source_default.cyan.dim(finalCommitMessage));
|
|
197995
197989
|
console.log("");
|
|
197996
197990
|
if (forceLLMGenerate || config$4.autoAcceptCommitMessage) break;
|
|
197997
197991
|
const action = await promptForGeneratedCommitAction();
|
|
@@ -197999,7 +197993,7 @@ async function mainController(options = {}) {
|
|
|
197999
197993
|
}
|
|
198000
197994
|
if (finalCommitMessage.length === 0) throw new Error("Commit message cannot be empty.");
|
|
198001
197995
|
console.log("");
|
|
198002
|
-
console.log(source_default.
|
|
197996
|
+
console.log(source_default.green("✓ Committing changes"));
|
|
198003
197997
|
if (!hasStaged) await git.add(["-A"]);
|
|
198004
197998
|
console.log(files.join("\n"));
|
|
198005
197999
|
console.log("");
|