From ec9e92b87e0c5afdbaafe10cd3db640a9fcf9f50 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 23 Nov 2026 14:56:03 +0000 Subject: pkgs/claude-inbox: list leaves out graveyards, but with --all A remote's stale branches it isn't sure to delete go to REMOTE/graveyard/*: kept, but out of the way. --list leaves them out, and completion doesn't offer them (they can still be named); --list --all shows them, too. --- pkgs/claude-inbox.nix | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pkgs/claude-inbox.nix b/pkgs/claude-inbox.nix index c5bdc02..f407b19 100644 --- a/pkgs/claude-inbox.nix +++ b/pkgs/claude-inbox.nix @@ -22,12 +22,13 @@ let What among the claude VM's repositories needs attention, and doing it. Commands: - --list [REPO] [--by-remote] + --list [REPO] [--by-remote] [--all] The default without BRANCH. Fetch the repositories the VM has (ssh HOST: its ~/src, but for symlinks), or just REPO, and show their branches with something master doesn't have (by content), those it has all of (to delete), and whether master needs - pushing. --by-remote: grouped by OWNER. + pushing. --by-remote: grouped by OWNER. --all: with the + graveyards, too (REMOTE/graveyard/*, kept but out of the way). --show [REPO|BRANCH] [--diff[=WHAT]] [--git=ARGS]... The default with BRANCH. Fetch REPO (or else all) first, show master..BRANCH, with patches, and mark BRANCH seen. Without @@ -133,7 +134,7 @@ let sed -E \ -e "s/^([A-Z][A-Za-z ]*:)$/$C_HEAD\1$C_OFF/" \ -e ":a; s/(^|$x)(--(list|show|take|push|checkout|stack)|COMMAND)($x|$)/\1$C_CMD\2$C_OFF\4/; ta" \ - -e ":b; s/(^|$x)(-d|--vm|--no-fetch|--by-remote|-f|--force|--pick|--diff|--git|-h|--help|OPTION)($x|$)/\1$C_OPT\2$C_OFF\3/; tb" \ + -e ":b; s/(^|$x)(-d|--vm|--no-fetch|--by-remote|--all|-f|--force|--pick|--diff|--git|-h|--help|OPTION)($x|$)/\1$C_OPT\2$C_OFF\3/; tb" \ -e ":c; s/(^|$x)(REPO)($x|$)/\1$C_REPO\2$C_OFF\3/; tc" \ -e ":d; s/(^|$x)(BRANCH)($x|$)/\1$C_BRANCH\2$C_OFF\3/; td" } @@ -187,6 +188,7 @@ let me=''${LOGNAME:-''${USER:-$(id -un)}} fetch=1 by=repo + all= cmd= force= pick= @@ -205,6 +207,7 @@ let --vm) vm=$2; shift ;; --no-fetch) fetch= ;; --by-remote) by=remote ;; + --all) all=1 ;; --list | --show | --take | --push | --checkout | --checkout=* | --stack | --stack=*) c=''${1%%=*} c=''${c#--} test -z "$cmd" || test "$cmd" = "$c" || die "--$cmd or --$c, not both" @@ -334,6 +337,7 @@ let test -z "$diff" || test "$cmd" = show || die "--diff is for --show" test ''${#gitargs[@]} = 0 || test "$cmd" = show || die "--git is for --show" test "$by" = repo || test "$cmd" = list || die "--by-remote is for --list" + test -z "$all" || test "$cmd" = list || die "--all is for --list" case $cmd in list) test -z "$b" || die "--list takes no BRANCH" ;; show) if test -z "$name"; then @@ -412,6 +416,7 @@ let refs/claude-seen/*) seen[''${ref#refs/claude-seen/}]=$tip ;; refs/remotes/claude/HEAD) ;; refs/remotes/claude/master) master=1 ;; + refs/remotes/claude/*/graveyard/*) test -z "$all" || branches+=("''${ref#refs/remotes/claude/}") tips+=("$tip") ages+=("$age") ;; refs/remotes/claude/*) branches+=("''${ref#refs/remotes/claude/}") tips+=("$tip") ages+=("$age") ;; esac @@ -647,7 +652,7 @@ let else git -C "$src/$n" for-each-ref --format='%(refname:lstrip=3)' refs/remotes/claude 2>/dev/null fi - done | grep -vx -e master -e HEAD | sort -u + done | grep -vx -e master -e HEAD -e '.*/graveyard/.*' | sort -u } # DIR PREFIX: the loose refs below DIR, by name _claude_inbox_loose() { @@ -720,7 +725,7 @@ let local cmds= opts="-d --vm --no-fetch" o left= repolist= branchlist= g c case $cmd in "") cmds="--list --show --take --push --checkout= --stack=" ;; - list) opts="$opts --by-remote" ;; + list) opts="$opts --by-remote --all" ;; show) opts="$opts --diff --git=" ;; take) opts="$opts -f --force --pick" ;; push) opts="$opts -f --force" ;; -- cgit v1.3.1