From 5f7c2964ac5eec85cd7f81a7ac6a6ebe2da84ab1 Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Wed, 10 Jun 2026 18:20:59 +0000 Subject: [PATCH] workstation: session-launch freshen follows the checked-out branch (not just master) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Viktor asked to log Anca into her GitHub account so she can develop on the devvm and deploy her apps through the existing CI/CD. Her GitHub repos (Plotting-Your-Dream-Book, travel, My-Wardrobe — now cloned into her ~/code workspace) default to main, and the launcher freshen only fast-forwarded master, silently skipping them. ff the current branch's upstream instead — same safety gates (on a branch, clean tree, upstream configured, ff-only). Single-layout infra clones behave identically. [ci skip] --- scripts/workstation/skel/start-claude.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/workstation/skel/start-claude.sh b/scripts/workstation/skel/start-claude.sh index 9778b2fc..4feb44d7 100755 --- a/scripts/workstation/skel/start-claude.sh +++ b/scripts/workstation/skel/start-claude.sh @@ -26,10 +26,12 @@ cd "$HOME/code" 2>/dev/null || cd "$HOME" # 10s fetch cap per repo so an offline remote never stalls the launch. freshen_repo() { GIT_TERMINAL_PROMPT=0 timeout 10 git -C "$1" fetch --all --prune --quiet 2>/dev/null || true - if [ "$(git -C "$1" symbolic-ref --short -q HEAD)" = master ] \ + # ff whatever branch is checked out (master, main, ...) when that is provably + # safe: on a branch, clean tree, upstream configured. Never rebases/merges. + if [ -n "$(git -C "$1" symbolic-ref --short -q HEAD)" ] \ && [ -z "$(git -C "$1" status --porcelain 2>/dev/null)" ] \ - && git -C "$1" rev-parse --verify -q 'master@{upstream}' >/dev/null 2>&1; then - git -C "$1" merge --ff-only 'master@{upstream}' >/dev/null 2>&1 || true + && git -C "$1" rev-parse --verify -q '@{upstream}' >/dev/null 2>&1; then + git -C "$1" merge --ff-only '@{upstream}' >/dev/null 2>&1 || true fi } if [ -d "$HOME/code/.git" ]; then