add sandlot log command to show branch commits not on main
This commit is contained in:
parent
586e72610a
commit
d4d0010632
21
src/cli.ts
21
src/cli.ts
|
|
@ -331,6 +331,27 @@ program
|
|||
}
|
||||
})
|
||||
|
||||
// ── sandlot log <branch> ────────────────────────────────────────────
|
||||
|
||||
program
|
||||
.command("log")
|
||||
.argument("<branch>", "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")
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user