Skip to content

Commit 48c0b37

Browse files
committed
add comment to parseNewGoodCommands - explain what needs to be done
Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
1 parent 0072052 commit 48c0b37

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,25 @@ export function parseNewGoodCommands(
7575

7676
let lastNewCommit: OldCommit | null = null;
7777

78+
/**
79+
* TODO FIXME
80+
*
81+
* we're going thru oldCommits and incrementing the `i`,
82+
* even though we jump thru and keep staying at the same `goodCommandMinIndex`.
83+
*
84+
* the oldCommits are from the rewrittenList,
85+
* meaning they only begin from where the first rewrite was done
86+
* (reword/edit/etc),
87+
*
88+
* so iterating thru them to generate a new list of good commands
89+
* ofc is broken.
90+
*
91+
* instead we need to go thru the old __commands__,
92+
* whom come from the old git-rebase-todo file (of stacked rebase),
93+
* and use the oldCommits/newCommits to re-generate the rebase todo,
94+
* but now adjusted to the commits that have been rewritten.
95+
*
96+
*/
7897
let goodCommandMinIndex = 1;
7998
for (let i = 0; i < oldCommits.length; i++) {
8099
const oldCommit: OldCommit = oldCommits[i];

0 commit comments

Comments
 (0)