From bc5816663cfe4db1d6c3e1076e9660a60f347aa7 Mon Sep 17 00:00:00 2001 From: Mark IJbema Date: Tue, 28 Apr 2026 13:05:57 +0200 Subject: [PATCH] fix(cli): skip .github/VOUCHED.td and surface git rm errors in upstream merge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The skip list in script/upstream/utils/config.ts matched .github/VOUCHED.md, but upstream actually ships .github/VOUCHED.td (typo extension), so the file fell through to manual resolution every merge. Broaden the pattern to .github/VOUCHED.* so both variants are handled. Also make skip-files removeFile report the real git rm stderr on failure and retry once. Transient index contention silently flipped a file to not-found in a recent run with no signal about why — now we'll see the error and shake off intermittent lock failures automatically. --- script/upstream/transforms/skip-files.ts | 28 +++++++++++++++--------- script/upstream/utils/config.ts | 6 +++-- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/script/upstream/transforms/skip-files.ts b/script/upstream/transforms/skip-files.ts index f4d10bfee6..ded740a4cd 100644 --- a/script/upstream/transforms/skip-files.ts +++ b/script/upstream/transforms/skip-files.ts @@ -90,11 +90,19 @@ async function fileExistsInRef(file: string, ref: string): Promise { } /** - * Remove a file from the merge (git rm) + * Remove a file from the merge (git rm). Retries once on failure since + * transient index contention (editor watchers, rerere passes) has been + * observed to make the first attempt fail sporadically. */ -async function removeFile(file: string): Promise { - const result = await $`git rm -f ${file}`.quiet().nothrow() - return result.exitCode === 0 +async function removeFile(file: string): Promise<{ ok: boolean; err?: string }> { + const first = await $`git rm -f ${file}`.quiet().nothrow() + if (first.exitCode === 0) return { ok: true } + + const retry = await $`git rm -f ${file}`.quiet().nothrow() + if (retry.exitCode === 0) return { ok: true } + + const err = retry.stderr.toString().trim() || first.stderr.toString().trim() + return { ok: false, err } } /** @@ -143,12 +151,12 @@ export async function skipFiles(options: SkipOptions = {}): Promise