Compare commits

..

3 Commits

Author SHA1 Message Date
1382f55964 7 2026-02-24 19:45:01 -08:00
a89d8482d2 Add color and pager support to log command 2026-02-24 19:07:39 -08:00
e6c9489137 6 2026-02-24 19:03:13 -08:00
2 changed files with 6 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@because/sandlot",
"version": "0.0.5",
"version": "0.0.7",
"description": "Sandboxed, branch-based development with Claude",
"type": "module",
"bin": {

View File

@ -1,12 +1,15 @@
import { $ } from "bun"
import { die } from "../fmt.ts"
import { die, yellow, reset, pager } from "../fmt.ts"
import { requireSession } from "./helpers.ts"
export async function action(branch: string) {
const { session } = await requireSession(branch)
const result = await $`git -C ${session.worktree} log main..HEAD`.nothrow()
const result = await $`git -C ${session.worktree} log --no-color main..HEAD`.nothrow().quiet()
if (result.exitCode !== 0) {
die("git log failed")
}
const output = result.text().replace(/^(commit [0-9a-f]+)/gm, `${yellow}$1${reset}`)
await pager(output)
}