Skip to content

Commit 7fa5475

Browse files
nicksenapclaude
andcommitted
Auto cd into workspace after create, fix dim rendering
- Remove --go flag from create; always emit cd sentinel - Update shell wrapper to intercept `create` subcommand - Fix info() using style= param to prevent [/] tag conflicts - Bump version to 0.5.3 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent cce7275 commit 7fa5475

File tree

6 files changed

+9
-22
lines changed

6 files changed

+9
-22
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "grove"
3-
version = "0.5.1"
3+
version = "0.5.3"
44
description = "Git Worktree Workspace Orchestrator"
55
readme = "README.md"
66
authors = [

shell/grove.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,7 @@ gw() {
1818
return $rc
1919
fi
2020

21-
# For create --go, use a temp file so stdout stays connected to the tty
22-
local has_go=false
23-
for arg in "$@"; do
24-
[ "$arg" = "--go" ] && has_go=true
25-
done
26-
27-
if [ "$has_go" = true ]; then
21+
if [ "$1" = "create" ]; then
2822
local tmpfile
2923
tmpfile="$(mktemp)"
3024
command gw "$@" | tee "$tmpfile"

src/grove/cli.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ def create(
192192
autocompletion=complete_preset_name,
193193
),
194194
all_repos: bool = typer.Option(False, "--all", help="Use all discovered repos"),
195-
go: bool = typer.Option(False, "--go", help="Print cd sentinel after creation"),
196195
) -> None:
197196
"""Create a new workspace with worktrees from selected repos."""
198197
cfg = config.require_config()
@@ -288,9 +287,8 @@ def create(
288287
console.print()
289288
success(f"Workspace [bold]{name}[/] created at {ws.path}")
290289

291-
if go:
292-
# Sentinel for shell function to intercept and cd
293-
print(f"__grove_cd:{ws.path}")
290+
# Sentinel for shell function to intercept and cd
291+
print(f"__grove_cd:{ws.path}")
294292

295293

296294
@app.command("list")
@@ -578,12 +576,7 @@ def shell_init() -> None:
578576
return $rc
579577
fi
580578
581-
local has_go=false
582-
for arg in "$@"; do
583-
[ "$arg" = "--go" ] && has_go=true
584-
done
585-
586-
if [ "$has_go" = true ]; then
579+
if [ "$1" = "create" ]; then
587580
local tmpfile
588581
tmpfile="$(mktemp)"
589582
command gw "$@" | tee "$tmpfile"

src/grove/console.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def success(msg: str) -> None:
1818

1919

2020
def info(msg: str) -> None:
21-
_err_console.print(f"[dim]{msg}[/]")
21+
_err_console.print(msg, style="dim")
2222

2323

2424
def warning(msg: str) -> None:

tests/test_cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def test_invalid_preset(self, tmp_grove, fake_repos):
133133
assert result.exit_code == 1
134134
assert "not found" in result.output
135135

136-
def test_go_flag_prints_sentinel(self, tmp_grove, fake_repos):
136+
def test_create_prints_cd_sentinel(self, tmp_grove, fake_repos):
137137
ws_path = tmp_grove["workspace_dir"] / "feat-go"
138138
mock_ws = Workspace(name="feat-go", path=ws_path, branch="feat/go", repos=[])
139139

@@ -144,7 +144,7 @@ def test_go_flag_prints_sentinel(self, tmp_grove, fake_repos):
144144
):
145145
mock_cfg.return_value = self._make_config(tmp_grove)
146146
mock_find.return_value = fake_repos
147-
result = runner.invoke(app, ["create", "-r", "svc-auth", "-b", "feat/go", "--go"])
147+
result = runner.invoke(app, ["create", "-r", "svc-auth", "-b", "feat/go"])
148148
assert result.exit_code == 0
149149
assert f"__grove_cd:{ws_path}" in result.output
150150

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)