From db816061a6269b8a554540726c2cd93070b36b1e Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Wed, 26 Aug 2026 22:54:57 -0400 Subject: [PATCH] setup --check: distinguish a missing rc worktree from no rc branch yet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --check warned 'rc worktree would be created' whenever the directory was absent, implying a plain setup run would create it — but with no rc branch in existence setup skips it, so the warning described something that would not happen and asked for action that was not possible. It now reports the branch state: present, would-create (branch exists), or nothing-to-do (no branch yet — the first RC cut creates the branch and the build trigger creates the worktree on demand). Branch detection is read-only, as --check must be. --- bin/setup | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/bin/setup b/bin/setup index 87317e6..78a32a5 100755 --- a/bin/setup +++ b/bin/setup @@ -201,11 +201,23 @@ echo "" # together. RC_WORKTREE="/root/omarchy-pkgs-rc" +# Read-only: --check must not fetch. Local refs first, then a network peek. +rc_branch_exists() { + git -C "$BUILD_ROOT" show-ref --verify --quiet refs/heads/rc && return 0 + git -C "$BUILD_ROOT" show-ref --verify --quiet refs/remotes/origin/rc && return 0 + git -C "$BUILD_ROOT" ls-remote --exit-code --heads origin rc >/dev/null 2>&1 +} + if [[ "$CHECK_ONLY" == true ]]; then if [[ -d "$RC_WORKTREE" ]]; then print_success "rc worktree present: $RC_WORKTREE" - else + elif rc_branch_exists; then print_warning "rc worktree would be created at $RC_WORKTREE" + else + # Expected before the first RC: nothing to create, and nothing to do — + # omarchy-release creates the branch and the rc build trigger creates the + # worktree on demand, so this resolves itself. + print_info "rc worktree not needed yet (no rc branch — created on the first RC cut)" fi elif [[ -d "$RC_WORKTREE" ]]; then print_success "rc worktree present: $RC_WORKTREE" @@ -217,9 +229,8 @@ else elif git -C "$BUILD_ROOT" show-ref --verify --quiet refs/remotes/origin/rc; then git -C "$BUILD_ROOT" worktree add --track -b rc "$RC_WORKTREE" origin/rc else - print_warning "No rc branch exists yet — skipping worktree" - echo " The release orchestrator creates the rc branch on the first RC cut;" - echo " re-run bin/setup afterwards." + print_info "No rc branch yet — the first RC cut creates it, and the rc build" + echo " trigger creates this worktree on demand. Nothing to do." fi fi echo ""