From d4d001063244a822f493114bd003653650bedb20 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Thu, 19 Feb 2026 10:12:06 -0800 Subject: [PATCH] add `sandlot log` command to show branch commits not on main --- src/cli.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/cli.ts b/src/cli.ts index 12ab2fd..8a2ee4e 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -331,6 +331,27 @@ program } }) +// ── sandlot log ──────────────────────────────────────────── + +program + .command("log") + .argument("", "branch name") + .description("Show commits on a branch that are not on main") + .action(async (branch: string) => { + const root = await git.repoRoot() + const session = await state.getSession(root, branch) + if (!session) { + console.error(`No session found for branch "${branch}".`) + process.exit(1) + } + + const result = await $`git -C ${session.worktree} log main..HEAD`.nothrow() + if (result.exitCode !== 0) { + console.error("git log failed") + process.exit(1) + } + }) + // ── sandlot vm ─────────────────────────────────────────────────────── const vmCmd = program.command("vm").description("Manage the sandlot VM")