Skip to content

Commit 748115b

Browse files
authored
Merge branch 'main' into fix-open-ai
2 parents b024b94 + 584c17a commit 748115b

File tree

4 files changed

+71
-4
lines changed

4 files changed

+71
-4
lines changed

CHANGELOG.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this
66

77
## [Unreleased]
88

9+
## [2.4.0] - 2026-02-24
10+
11+
### Added
12+
13+
- Interactive fzf worktree picker for `gtr cd` with preview, keybindings, and multi-action support ([#136](https://github.com/coderabbitai/git-worktree-runner/pull/136))
14+
- Helpful error message when running `git gtr cd` explaining shell integration requirement ([#137](https://github.com/coderabbitai/git-worktree-runner/pull/137))
15+
16+
### Changed
17+
18+
- Limit `find` depth for simple directory copy patterns for better performance ([#130](https://github.com/coderabbitai/git-worktree-runner/pull/130))
19+
20+
### Fixed
21+
22+
- Root-level files now matched correctly for `**` glob patterns on Bash 3.2 ([#133](https://github.com/coderabbitai/git-worktree-runner/pull/133))
23+
- Antigravity adapter support ([#131](https://github.com/coderabbitai/git-worktree-runner/pull/131))
24+
925
## [2.3.1] - 2026-02-17
1026

1127
### Added
@@ -140,7 +156,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this
140156

141157
- Improved base directory resolution logic to distinguish `.` (repo root), `./path` (repo-internal) from other relative values (sibling directories)
142158

143-
[Unreleased]: https://github.com/coderabbitai/git-worktree-runner/compare/v2.3.1...HEAD
159+
[Unreleased]: https://github.com/coderabbitai/git-worktree-runner/compare/v2.4.0...HEAD
160+
[2.4.0]: https://github.com/coderabbitai/git-worktree-runner/compare/v2.3.1...v2.4.0
144161
[2.3.1]: https://github.com/coderabbitai/git-worktree-runner/compare/v2.3.0...v2.3.1
145162
[2.3.0]: https://github.com/coderabbitai/git-worktree-runner/compare/v2.2.0...v2.3.0
146163
[2.2.0]: https://github.com/coderabbitai/git-worktree-runner/compare/v2.1.0...v2.2.0

bin/git-gtr

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if [ -n "${GTR_DEBUG:-}" ]; then
1111
fi
1212

1313
# Version
14-
GTR_VERSION="2.3.1"
14+
GTR_VERSION="2.4.0"
1515

1616
# Find the script directory (resolve symlinks; allow env override)
1717
resolve_script_dir() {
@@ -106,6 +106,14 @@ main() {
106106
help|--help|-h)
107107
cmd_help "$@"
108108
;;
109+
cd)
110+
local _shell_name
111+
_shell_name="$(basename "${SHELL:-bash}")"
112+
log_error "'cd' requires shell integration (subprocesses cannot change your shell's directory)"
113+
log_info "Set up with: eval \"\$(git gtr init $_shell_name)\""
114+
log_info "Then use: gtr cd [<branch>]"
115+
exit 1
116+
;;
109117
*)
110118
log_error "Unknown command: $cmd"
111119
echo "Use 'git gtr help' for available commands"

lib/commands/doctor.sh

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,32 @@ cmd_doctor() {
114114

115115
# Check fzf (optional, for interactive picker)
116116
if command -v fzf >/dev/null 2>&1; then
117-
echo "[OK] fzf: $(fzf --version 2>/dev/null | awk '{print $1}') (interactive picker available)"
117+
echo "[OK] fzf: $(fzf --version 2>/dev/null | awk '{print $1}') (interactive picker: gtr cd)"
118118
else
119119
echo "[i] fzf: not found (install for interactive picker: gtr cd)"
120120
fi
121121

122+
# Check shell integration (required for gtr cd)
123+
local _shell_name _rc_file
124+
_shell_name="$(basename "${SHELL:-bash}")"
125+
case "$_shell_name" in
126+
zsh) _rc_file="$HOME/.zshrc" ;;
127+
bash) _rc_file="$HOME/.bashrc" ;;
128+
fish) _rc_file="$HOME/.config/fish/config.fish" ;;
129+
*) _rc_file="" ;;
130+
esac
131+
if [ -n "$_rc_file" ] && [ -f "$_rc_file" ] && grep -q 'git gtr init' "$_rc_file" 2>/dev/null; then
132+
echo "[OK] Shell integration: loaded (gtr cd available)"
133+
elif [ -n "$_rc_file" ]; then
134+
local _init_hint
135+
if [ "$_shell_name" = "fish" ]; then
136+
_init_hint="git gtr init fish | source"
137+
else
138+
_init_hint="eval \"\$(git gtr init $_shell_name)\""
139+
fi
140+
echo "[i] Shell integration: $_init_hint in ${_rc_file##*/} for gtr cd"
141+
fi
142+
122143
echo ""
123144
if [ "$issues" -eq 0 ]; then
124145
echo "Everything looks good!"

lib/commands/init.sh

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ __FUNC__() {
8585
if [ "$#" -eq 0 ] && command -v fzf >/dev/null 2>&1; then
8686
local _gtr_selection _gtr_key _gtr_line
8787
_gtr_selection="$(command git gtr list --porcelain | fzf \
88+
local _gtr_porcelain
89+
_gtr_porcelain="$(command git gtr list --porcelain)"
90+
if [ "$(printf '%s\n' "$_gtr_porcelain" | wc -l)" -le 1 ]; then
91+
echo "No worktrees to pick from. Create one with: git gtr new <branch>" >&2
92+
return 0
93+
fi
94+
local _gtr_selection
95+
_gtr_selection="$(printf '%s\n' "$_gtr_porcelain" | fzf \
8896
--delimiter=$'\t' \
8997
--with-nth=2 \
9098
--ansi \
@@ -195,6 +203,14 @@ __FUNC__() {
195203
if [ "$#" -eq 0 ] && command -v fzf >/dev/null 2>&1; then
196204
local _gtr_selection _gtr_key _gtr_line
197205
_gtr_selection="$(command git gtr list --porcelain | fzf \
206+
local _gtr_porcelain
207+
_gtr_porcelain="$(command git gtr list --porcelain)"
208+
if [ "$(printf '%s\n' "$_gtr_porcelain" | wc -l)" -le 1 ]; then
209+
echo "No worktrees to pick from. Create one with: git gtr new <branch>" >&2
210+
return 0
211+
fi
212+
local _gtr_selection
213+
_gtr_selection="$(printf '%s\n' "$_gtr_porcelain" | fzf \
198214
--delimiter=$'\t' \
199215
--with-nth=2 \
200216
--ansi \
@@ -307,7 +323,12 @@ function __FUNC__
307323
if test (count $argv) -gt 0; and test "$argv[1]" = "cd"
308324
set -l dir
309325
if test (count $argv) -eq 1; and type -q fzf
310-
set -l _gtr_selection (command git gtr list --porcelain | fzf \
326+
set -l _gtr_porcelain (command git gtr list --porcelain)
327+
if test (count $_gtr_porcelain) -le 1
328+
echo "No worktrees to pick from. Create one with: git gtr new <branch>" >&2
329+
return 0
330+
end
331+
set -l _gtr_selection (printf '%s\n' $_gtr_porcelain | fzf \
311332
--delimiter=\t \
312333
--with-nth=2 \
313334
--ansi \

0 commit comments

Comments
 (0)