Add condition to run LLM commit rewrite only if needsRelocation is false
This commit is contained in:
26
main.js
26
main.js
@@ -474,18 +474,20 @@ async function rewordCommitsSequentially(repoPath, commitMessageMap, hashes) {
|
|||||||
|
|
||||||
//---- 6. Workflow ----
|
//---- 6. Workflow ----
|
||||||
async function runLLMCommitRewrite(folderObj) {
|
async function runLLMCommitRewrite(folderObj) {
|
||||||
const hashes = folderObj.llmCandidates;
|
if(!folderObj.needsRelocation){
|
||||||
const birthday = folderObj.firstCandidateBirthday;
|
const hashes = folderObj.llmCandidates;
|
||||||
const folderPath = folderObj.path;
|
const birthday = folderObj.firstCandidateBirthday;
|
||||||
folderObj.llmCandidates = [];
|
const folderPath = folderObj.path;
|
||||||
folderObj.firstCandidateBirthday = null;
|
folderObj.llmCandidates = [];
|
||||||
folders[idx].linesChanged = 0;
|
folderObj.firstCandidateBirthday = null;
|
||||||
const prompt = await generateLLMCommitMessages(folderPath, hashes);
|
folders[idx].linesChanged = 0;
|
||||||
const llmRaw = await streamLLMCommitMessages(prompt, chunk => process.stdout.write(chunk));
|
const prompt = await generateLLMCommitMessages(folderPath, hashes);
|
||||||
const commitList = parseLLMCommitMessages(llmRaw);
|
const llmRaw = await streamLLMCommitMessages(prompt, chunk => process.stdout.write(chunk));
|
||||||
const messageMap = {};
|
const commitList = parseLLMCommitMessages(llmRaw);
|
||||||
for (const entry of commitList) messageMap[entry.commit] = entry.newMessage;
|
const messageMap = {};
|
||||||
await rewordCommitsSequentially(folderPath, messageMap, hashes);
|
for (const entry of commitList) messageMap[entry.commit] = entry.newMessage;
|
||||||
|
await rewordCommitsSequentially(folderPath, messageMap, hashes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user