diff --git a/src/commands/helpers.ts b/src/commands/helpers.ts index 44b31b9..a5dc0c5 100644 --- a/src/commands/helpers.ts +++ b/src/commands/helpers.ts @@ -85,10 +85,11 @@ export async function teardownSession(root: string, branch: string, worktree: st export async function resolveConflicts( files: string[], cwd: string, - onFile: (file: string) => void, + onFile: (file: string, index: number, total: number) => void, ): Promise { - for (const file of files) { - onFile(file) + for (let i = 0; i < files.length; i++) { + const file = files[i] + onFile(file, i + 1, files.length) const content = await Bun.file(join(cwd, file)).text() const resolved = await vm.claudePipe( @@ -142,7 +143,9 @@ export async function mergeAndClose(branch: string, opts?: { squash?: boolean; f try { await vm.ensure((msg) => { spin.text = msg }) if (session) await vm.setActivity(session.worktree, branch) - await resolveConflicts(conflicts, root, (file) => { spin.text = `Resolving ${file}` }) + await resolveConflicts(conflicts, root, (file, i, total) => { + spin.text = total > 1 ? `(${i}/${total}) Resolving ${file}` : `Resolving ${file}` + }) if (opts?.squash) { await squashCommit(branch, root) diff --git a/src/commands/rebase.ts b/src/commands/rebase.ts index c1012f2..ff8dda1 100644 --- a/src/commands/rebase.ts +++ b/src/commands/rebase.ts @@ -41,8 +41,10 @@ export async function action(branch: string) { throw new Error(`Exceeded ${MAX_REBASE_ROUNDS} conflict resolution rounds — aborting rebase`) } - await resolveConflicts(conflicts, worktree, (file) => { - resolveSpin.text = `Resolving ${file} (round ${round})` + await resolveConflicts(conflicts, worktree, (file, i, total) => { + resolveSpin.text = total > 1 + ? `(${i}/${total}) Resolving ${file} (round ${round})` + : `Resolving ${file} (round ${round})` }) conflicts = await git.rebaseContinue(worktree)