This commit is contained in:
di-sukharev
2023-05-21 11:28:48 +08:00
parent b4ecce224b
commit 447a938a48
2 changed files with 21 additions and 2 deletions

View File

@@ -27287,8 +27287,17 @@ async function improveCommitMessagesWithRebase({
ce(`creating -F file for ${commit.sha}`);
(0, import_fs2.writeFileSync)(`./commit-${i2}.txt`, improvedMessagesBySha[commit.sha]);
});
(0, import_fs2.writeFileSync)(
`./rebase-exec.sh`,
`
#!/bin/bash
count=$(cat count.txt)
git commit --amend -F commit-$count.txt
echo $(( count + 1 )) > count.txt
`
);
await execPromise(
`echo 0 > count.txt && git rebase ${commitsToImprove[0].sha}^ --exec "git commit --amend -F commit-$(cat count.txt).txt && echo $(( $(cat count.txt) + 1 )) > count.txt"`,
`git rebase ${commitsToImprove[0].sha}^ --exec "./rebase-exec.sh"`,
{
env: {
GIT_SEQUENCE_EDITOR: 'sed -i -e "s/^pick/reword/g"',

View File

@@ -178,8 +178,18 @@ async function improveCommitMessagesWithRebase({
// }
// );
writeFileSync(
`./rebase-exec.sh`,
`
#!/bin/bash
count=$(cat count.txt)
git commit --amend -F commit-$count.txt
echo $(( count + 1 )) > count.txt
`
);
await execPromise(
`echo 0 > count.txt && git rebase ${commitsToImprove[0].sha}^ --exec "git commit --amend -F commit-$(cat count.txt).txt && echo $(( $(cat count.txt) + 1 )) > count.txt"`,
`git rebase ${commitsToImprove[0].sha}^ --exec "./rebase-exec.sh"`,
{
env: {
GIT_SEQUENCE_EDITOR: 'sed -i -e "s/^pick/reword/g"',