From 138a8cfee9fa0e9319a5035b84ac041d22d33051 Mon Sep 17 00:00:00 2001 From: Kipras Melnikovas Date: Mon, 28 Mar 2022 18:18:56 +0300 Subject: [PATCH] reducePath extras Signed-off-by: Kipras Melnikovas --- reducePath.ts | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/reducePath.ts b/reducePath.ts index 2fcbdba4..b63c2448 100755 --- a/reducePath.ts +++ b/reducePath.ts @@ -132,10 +132,34 @@ export function combineRewrittenLists(rewrittenListFileContent: string): Combine // pointless continue } else { - throw new Error( - `NOT IMPLEMENTED - identical key in 'amend' and 'rebase', but different values.` - + `(key = "${key}", amend's value = "${value}", rebase's value = "${list.mapping[key]}")` - ) + //throw new Error( + // `NOT IMPLEMENTED - identical key in 'amend' and 'rebase', but different values.` + //+ `(key = "${key}", amend's value = "${value}", rebase's value = "${list.mapping[key]}")` + //) + + /** + * amend + * A->B + * + * rebase + * A->C + * + * + * hmm. + * will we need to keep track of _when_ the post-rewrite happened as well? + * (i.e. on what commit) + * though, idk if that's possible, i think i already tried, + * but since the post-rewrite script is called _after_ the amend/rebase happens, + * it gives you the same commit that you already have, + * i.e. the already rewritten one, instead of the previous one... + * + */ + + /** + * for starters, we can try always favoring the amend over rebase + */ + Object.assign(list.mapping, amend.mapping) + } } else { if (Object.values(list.mapping).includes(key)) {