Files
dotfiles/home/dot_config/fish/functions/wts.fish
Xevion 8804b425fb feat: add git worktree management utilities for Fish and Bash
Add comprehensive worktree tooling with FZF integration:
- wtb: create branch worktree with gitignored file cloning
- wtcd/wtr: interactive picker and multi-remove with FZF
- wtf/wth: feature/hotfix branch shortcuts
- wts/wtl: status overview and listing
- Automatic .worktrees/ organization and .gitignore management
2026-01-23 13:42:30 -06:00

32 lines
1.3 KiB
Fish

function wts --description "Show git status for all worktrees"
set -l root (git rev-parse --show-toplevel 2>/dev/null)
if test -z "$root"
echo "Not in a git repository" >&2
return 1
end
for wt_path in (git worktree list --porcelain | grep '^worktree ' | string replace 'worktree ' '')
set -l branch (git -C "$wt_path" symbolic-ref --short HEAD 2>/dev/null; or echo "detached")
# Print header with box drawing
set_color --bold blue
echo "╭─────────────────────────────────────────────────────────────╮"
echo -n "│ "
set_color --bold yellow
echo -n "$wt_path"
set_color normal
echo ""
set_color --bold blue
echo -n "│ "
set_color cyan
echo "[$branch]"
set_color --bold blue
echo "╰─────────────────────────────────────────────────────────────╯"
set_color normal
# Run git status
git -C "$wt_path" status --short
echo ""
end
end