Skip to content

Commit c61789c

Browse files
committed
rename goodCommands to oldGoodCommands
Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
1 parent e6c31b0 commit c61789c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

parse-todo-of-stacked-rebase/parseNewGoodCommands.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ export function parseNewGoodCommands(
1717
pathToStackedRebaseTodoFile: string, //
1818
rewrittenListFile: typeof filenames.rewrittenList | typeof filenames.rewrittenListApplied
1919
): GoodCommand[] {
20-
const goodCommands: GoodCommand[] = parseTodoOfStackedRebase(pathToStackedRebaseTodoFile);
20+
const oldGoodCommands: GoodCommand[] = parseTodoOfStackedRebase(pathToStackedRebaseTodoFile);
2121

22-
logGoodCmds(goodCommands);
22+
logGoodCmds(oldGoodCommands);
2323

2424
const pathOfRewrittenList: string = path.join(repo.path(), "stacked-rebase", rewrittenListFile);
2525
const rewrittenList: string = fs.readFileSync(pathOfRewrittenList, { encoding: "utf-8" });
@@ -71,7 +71,7 @@ export function parseNewGoodCommands(
7171
*/
7272
const goodNewCommands: GoodCommand[] = [];
7373

74-
goodNewCommands.push(goodCommands[0]);
74+
goodNewCommands.push(oldGoodCommands[0]);
7575

7676
let lastNewCommit: OldCommit | null = null;
7777

@@ -98,7 +98,7 @@ export function parseNewGoodCommands(
9898
for (let i = 0; i < oldCommits.length; i++) {
9999
const oldCommit: OldCommit = oldCommits[i];
100100

101-
const oldCommandAtIdx: GoodCommand = goodCommands[goodCommandMinIndex];
101+
const oldCommandAtIdx: GoodCommand = oldGoodCommands[goodCommandMinIndex];
102102

103103
if (oldCommandAtIdx.commandName in stackedRebaseCommands) {
104104
goodNewCommands.push({
@@ -108,7 +108,7 @@ export function parseNewGoodCommands(
108108
goodCommandMinIndex++;
109109
}
110110

111-
const goodOldCommand = goodCommands.find((cmd) => cmd.targets?.[0] === oldCommit.oldSHA);
111+
const goodOldCommand = oldGoodCommands.find((cmd) => cmd.targets?.[0] === oldCommit.oldSHA);
112112

113113
if (!goodOldCommand) {
114114
throw new Error("TODO: goodCommandOld not found");
@@ -155,20 +155,20 @@ export function parseNewGoodCommands(
155155
//
156156
}
157157

158-
goodNewCommands.push(goodCommands[goodCommands.length - 1]);
158+
goodNewCommands.push(oldGoodCommands[oldGoodCommands.length - 1]);
159159

160160
// console.log({ goodNewCommands });
161161
console.log({
162-
len: goodCommands.length,
163-
goodCommands: goodCommands.map((c) => c.commandOrAliasName + ": " + c.targets?.join(", ") + "."),
162+
len: oldGoodCommands.length,
163+
goodCommands: oldGoodCommands.map((c) => c.commandOrAliasName + ": " + c.targets?.join(", ") + "."),
164164
});
165165

166166
console.log({
167167
len: goodNewCommands.length,
168168
goodNewCommands: goodNewCommands.map((c) => c.commandOrAliasName + ": " + c.targets?.join(", ") + "."),
169169
});
170170

171-
const stackedRebaseCommandsOld = goodCommands.filter((cmd) => cmd.commandName in stackedRebaseCommands);
171+
const stackedRebaseCommandsOld = oldGoodCommands.filter((cmd) => cmd.commandName in stackedRebaseCommands);
172172
const stackedRebaseCommandsNew: GoodCommand[] = goodNewCommands
173173
.map((cmd, i) =>
174174
cmd.commandName in stackedRebaseCommands

0 commit comments

Comments
 (0)