Skip to content

Commit 717a3c9

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

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
@@ -74,6 +74,25 @@ export function parseNewGoodCommands(
7474

7575
let lastNewCommit: OldCommit | null = null;
7676

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

0 commit comments

Comments
 (0)