fix(cli): task-setup uses --path-format=absolute for git-common-dir#900
Conversation
The previous fix (#899) called `git rev-parse --git-common-dir` without forcing absolute output. Without that, git returns a path relative to its cwd ("../.git"), and `dirname` of that resolves against whatever the caller's cwd happens to be — so running `make task-setup` from the main repo landed worktrees at /Users/burakemre/Code/.claude/worktrees/<name>/ (parent of the lobu checkout) instead of /Users/burakemre/Code/lobu/.claude/worktrees/<name>/. Fix: pass `--path-format=absolute` so git always returns the full path. `dirname` of an absolute /.../lobu/.git is reliably the main checkout. Verified by hand: from main: /Users/burakemre/Code/lobu from worktree: /Users/burakemre/Code/lobu
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe script now resolves the repo path using ChangesWorktree Path Resolution
🎯 2 (Simple) | ⏱️ ~5 minutes
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…et route + SPA copy (#909) * feat(server,scripts): local-first polish — magic-link gating, task-use bug, no_user_yet route Five small gaps from the post-passkey audit, bundled per @burak's request to ship together. Server changes: 1. auth/config.ts: magic-link is now hidden when RESEND_API_KEY is unset, regardless of NODE_ENV. Previously `magicLink: hasValue(RESEND_API_KEY) || !isProduction` rendered the "Send me a magic link" button in dev — clicking it logged the URL to server stdout but didn't email anything. Operators staring at their inbox never found it. Now `magicLink: hasValue(env.RESEND_API_KEY)` — visible exactly when delivery actually works. 2. auth/routes.ts /api/local-init: the no_user_yet response's signup_url was "/sign-up", but Owletto's SPA routes signup via /auth/sign-up (the /auth/$pathname.tsx shim → /auth/login?intent=sign-up). Bare /sign-up fell into the $owner catch-all and looped through the login redirect. Codex caught this on the polish PR's review. Fixed to "/auth/sign-up". Scripts: 3. task-use.sh: same $script_dir/.. bug fixed in task-setup.sh by PR #900. Without it, running task-use from inside a worktree retargets the chrome/mac symlinks at nested paths inside the calling worktree instead of the main checkout. Fix is the identical one-liner: `git rev-parse --path-format=absolute --git-common-dir`. Submodule bump: 4. packages/owletto → 19221e9 (lobu-ai/owletto#191): - login.tsx branches copy on singleUserMode + auto-enrolls a passkey after first signup. - AppState.swift handles no_user_yet by opening the browser at the signup URL (using URL APIs, not string concat). Verified: - make typecheck clean - bun test packages/server/src/__tests__/unit — 201 pass - xcodebuild Owletto Debug — BUILD SUCCEEDED - Codex reviewed; caught the /sign-up route mismatch + unsafe URL concat; both fixed before push. * chore(submodule): bump owletto to 2b74ac24ca3a98ac5193cfd0b7f106e6fcded0ce (polish merged)
… PORT (#912) Three small dev-script fixes shaped by codex review of the worktree workflow. - task-clean.sh repo resolution: invoking from inside a worktree resolved $repo to that worktree (not the main checkout), so the worktree_dir + branch deletion paths targeted the wrong place. Switch to `git rev-parse --git-common-dir --path-format=absolute`, matching the fix task-setup.sh (#900) and task-use.sh already use. - task-clean.sh: warn when `lobu context rm` fails or when the CLI isn't on PATH, mirroring task-setup.sh:188's symmetry. Silent failure left stale context entries after a clean. - task-use.sh: drop the active/mac symlink. The Mac menubar reads ~/.config/lobu/config.json on every popover expand and shows each context's apiUrl independently (AppState.swift:456 refreshContexts) — per-worktree contexts already appear in the picker. Devs open Xcode at the worktree's packages/owletto/apps/mac directly. The remaining Chrome symlink is the only one task-use manages now. - task-use.sh: read PORT from the worktree's .env.local and print it in the success message. The Chrome ext's gateway URL (sidepanel "Server URL" → chrome.storage.local) and the source symlink are independent switches; surfacing PORT every invocation makes the "still talking to the old worktree's gateway" footgun visible. Tested locally: ran `bash scripts/task-use.sh task-script-fixes` end-to-end inside this worktree; chrome symlink retargets, PORT (8789) appears in the reminder.
Summary
Follow-up to #899. The previous fix called
git rev-parse --git-common-dirwithout forcing absolute output. From inside a checkout, git returns a path relative to its cwd (../.git), anddirnameof that resolves against whatever directory the caller happens to be in. Net result:Fix
Pass
--path-format=absoluteso git always returns the full path (e.g./Users/burakemre/Code/lobu/.git).dirnameof an absolute path is invariant to cwd.Verification
Caught while validating #899 — same logic but two cwds wrong.
Summary by CodeRabbit