Skip to content

fix: show relative worktree paths in interactive picker#13

Merged
ahmedelgabri merged 1 commit intomainfrom
fix/interactive-display-slash-paths
Feb 18, 2026
Merged

fix: show relative worktree paths in interactive picker#13
ahmedelgabri merged 1 commit intomainfrom
fix/interactive-display-slash-paths

Conversation

@ahmedelgabri
Copy link
Owner

Summary

  • Fix format_worktree_for_display() to show relative paths (e.g. feature/my-thing) instead of just the basename (my-thing) in the interactive fzf picker
  • Pass bare_root from build_worktree_display_list() so workspace name is computed as a relative path from bare root
  • Add 4 tests covering interactive round-trip and display format verification for slash-containing worktrees

Before/After

For worktree at <bare-root>/feature/my-thing:

Display
Before my-thing [feature/my-thing] ~/repo/feature/my-thing
After feature/my-thing [feature/my-thing] ~/repo/feature/my-thing

Simple worktrees like main are unchanged.

Test plan

  • shellcheck git-wt passes
  • All 104 bats tests pass (4 new)
  • nix fmt -- no formatting changes
  • Pre-commit and pre-push hooks pass

Closes #11

@ahmedelgabri ahmedelgabri force-pushed the fix/interactive-display-slash-paths branch from c464ab9 to dba954d Compare February 18, 2026 08:33
@ahmedelgabri ahmedelgabri merged commit 943b225 into main Feb 18, 2026
7 checks passed
@ahmedelgabri ahmedelgabri deleted the fix/interactive-display-slash-paths branch February 18, 2026 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

git wt add defaults to slash-containing worktree paths, creating nested directories and breaking git wt remove

1 participant