This commit is contained in:
di-sukharev
2023-05-21 00:00:42 +08:00
parent 65c9c729de
commit 430f08a705
2 changed files with 8 additions and 30 deletions

View File

@@ -27284,20 +27284,9 @@ async function improveCommitMessagesWithRebase({
ce(`creating -F file for ${commit.sha}`);
(0, import_fs2.writeFileSync)(`./commit-${i2}.txt`, improvedMessagesBySha[commit.sha]);
});
const done1 = await import_exec.default.exec(
"echo",
[
"0",
">",
"count.txt",
"&&",
"git",
"rebase",
"-i",
`${commitsToImprove[0].sha}^`,
"--exec",
"git commit --amend -F commit-$(cat count.txt).txt && echo $(($(cat count.txt) + 1)) > count.txt"
],
const done = await import_exec.default.exec(
'echo 0 > count.txt && git rebase -i ${commitsToImprove[0].sha}^ --exec "git commit --amend -F commit-$(cat count.txt).txt && echo $(($(cat count.txt) + 1)) > count.txt"',
[],
{
env: {
GIT_SEQUENCE_EDITOR: 'sed -i -e "s/^pick/reword/g"',
@@ -27306,7 +27295,7 @@ async function improveCommitMessagesWithRebase({
}
}
);
ce(`!!!done: ${done1}`);
ce(`!!!done: ${done}`);
commitsToImprove.forEach((_commit, i2) => (0, import_fs2.unlinkSync)(`./commit-${i2}.txt`));
ce("Force pushing interactively rebased commits into remote origin.");
await import_exec.default.exec("git", ["status"]);

View File

@@ -163,20 +163,9 @@ async function improveCommitMessagesWithRebase({
});
// echo 0 > count.txt && git rebase <sha>^ --exec "git commit --amend -F \$(cat count.txt).txt && echo \$((\$(cat count.txt) + 1)) > count.txt"
const done1 = await exec.exec(
'echo',
[
'0',
'>',
'count.txt',
'&&',
'git',
'rebase',
'-i',
`${commitsToImprove[0].sha}^`,
'--exec',
'git commit --amend -F commit-$(cat count.txt).txt && echo $(($(cat count.txt) + 1)) > count.txt'
],
const done = await exec.exec(
'echo 0 > count.txt && git rebase -i ${commitsToImprove[0].sha}^ --exec "git commit --amend -F commit-$(cat count.txt).txt && echo $(($(cat count.txt) + 1)) > count.txt"',
[],
{
env: {
GIT_SEQUENCE_EDITOR: 'sed -i -e "s/^pick/reword/g"',
@@ -203,7 +192,7 @@ async function improveCommitMessagesWithRebase({
// }
// );
outro(`!!!done: ${done1}`);
outro(`!!!done: ${done}`);
commitsToImprove.forEach((_commit, i) => unlinkSync(`./commit-${i}.txt`));