Skip to content

Conversation

@hasit
Copy link

@hasit hasit commented Dec 10, 2025

Summary by CodeRabbit

  • Documentation
    • Added setup instructions for enabling Fish shell completions, including steps to create the necessary symlink and reload the shell.
  • Chores
    • Added a pre-merge shell validation check that enforces shell-script syntax and requires broad-shell examples; failures will block merges until fixed.

✏️ Tip: You can customize this high-level summary in your review settings.

@hasit hasit requested a review from NatoBoram as a code owner December 10, 2025 18:59
@coderabbitai
Copy link

coderabbitai bot commented Dec 10, 2025

Walkthrough

Added informational output to a setup script that instructs how to enable Fish shell completions for the gtr command, and introduced a new pre-merge shell-check rule in .coderabbit.yaml to validate shell scripts during pre-merge checks.

Changes

Cohort / File(s) Summary
Setup script
templates/setup-example.sh
Appended four lines of informational output guiding users to create a symlink to gtr.fish and reload Fish to enable completions.
CI / pre-merge checks
.coderabbit.yaml
Added pre_merge_checks.custom_checks entry defining a shell-check rule (mode: error) with instructions to validate shell script syntax and provide examples for multiple shells.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review areas to focus on:
    • .coderabbit.yaml: ensure the new check syntax and failure mode align with existing pre-merge framework.
    • templates/setup-example.sh: confirm instructional text is accurate and non-disruptive to script output formatting.

Poem

🐰
I hopped into a setup file at night,
and left a hint to make Fish completions light.
A config now watches shells with care,
symlinks twinkle, and checks declare—
hop on, the workflow's feeling bright! 🌙✨

Pre-merge checks and finishing touches

Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore
❌ Failed checks (1 error)
Check name Status Explanation Resolution
Shell-Check ❌ Error The shell-check custom check contains a spelling error ('sytactically' instead of 'syntactically') and setup-example.sh lacks examples for bash and zsh shells as required. Fix the typo in .coderabbit.yaml line 24 and add bash and zsh setup examples to setup-example.sh.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding Fish shell completion instructions to the setup script.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
templates/setup-example.sh (1)

36-40: Quote the example path for consistency with coding guidelines.

While line 39 contains example text that users will customize, the path should be quoted per the shell scripting guidelines to handle potential spaces and special characters.

Apply this diff to quote the path:

  echo "To enable fish shell completions for git gtr, run:"
- echo "  ln -s /path/to/git-worktree-runner/completions/gtr.fish ~/.config/fish/completions/"
+ echo "  ln -s \"/path/to/git-worktree-runner/completions/gtr.fish\" ~/.config/fish/completions/"
  echo "Then reload fish with: exec fish"

As a secondary note: The file's shebang on line 1 is #!/bin/sh, but per your coding guidelines it should be #!/usr/bin/env bash. This is a pre-existing issue and may be intentional for portability, but worth considering for a future update.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 9fd4e85 and 6e3b6cd.

📒 Files selected for processing (1)
  • templates/setup-example.sh (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.sh

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.sh: Always quote paths to handle spaces and special characters; avoid unguarded globbing
Keep set -e active in shell scripts; ensure non-critical failures are guarded with command || true

**/*.sh: Use shebang #!/usr/bin/env bash (not /bin/bash or /bin/sh)
Use snake_case naming for functions
Use snake_case for local variables and UPPER_CASE for constants/environment variables
Use 2-space indentation (no tabs)
Always quote variables and paths to handle spaces and special characters
Check return codes and use || exit 1 or || return 1 for error handling
Use local for function-scoped variables to avoid polluting global namespace
Target Bash 3.2+ compatibility in shell scripts

Files:

  • templates/setup-example.sh
**/*.{bash,fish,sh}

📄 CodeRabbit inference engine (.github/instructions/sh.instructions.md)

**/*.{bash,fish,sh}: Bash 3.2+ compatible (macOS default), but 4.0+ features allowed where appropriate
Always quote variables: use "$var" not $var
Use function-scoped variables: local var="value"
Check return codes; functions return 1 on failure
Use snake_case for functions and variables, UPPER_CASE for constants
Prefer [ ] over [[ ]] for POSIX portability; use [[ only when needed
Always quote glob inputs; disable unintended globbing with set -f temporarily if required
Avoid associative arrays in shell scripts; use simple string/loop constructs for Bash 3.2+ compatibility
Avoid readarray and process substitution unsupported in older Bash
Debug with bash -x ./bin/gtr <cmd> or wrap suspicious blocks with set -x / set +x
Check function presence with declare -f create_worktree or declare -f resolve_target
Use stderr for variable inspection: echo "DEBUG var=$var" >&2 to keep stdout clean for command substitution
Keep dependencies minimal: only use git, sed, awk, find, grep; avoid jq/curl unless justified
Check availability of external commands before use when adding new tools
Use "${var}" for variable expansion; for line loops use while IFS= read -r line; do ... done to preserve spaces
Sanitize branch names via sanitize_branch_name function; do NOT duplicate logic elsewhere
Everything is sourced at startup with set -e enabled; functions call each other directly; no subshells except for hooks and AI tools

Files:

  • templates/setup-example.sh
🔇 Additional comments (1)
templates/setup-example.sh (1)

37-40: The informational content is clear and helpful.

The added Fish shell completion instructions are well-placed at the end of the script and don't disrupt the existing flow. The tone matches the existing output style with the emoji and confirmation messaging.

@hasit
Copy link
Author

hasit commented Dec 10, 2025

@coderabbitai clone the repo and give me a summary of the last 20 commits on main.

@coderabbitai
Copy link

coderabbitai bot commented Dec 10, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Checkout main branch
git checkout main

# Get the last 20 commits on main with a concise format
echo "=== Last 20 commits on main branch ==="
git log -20 --pretty=format:"%h | %ad | %an | %s" --date=short

echo -e "\n\n=== Detailed summary ==="
# Get more detailed information
git log -20 --pretty=format:"Commit: %h%nAuthor: %an <%ae>%nDate: %ad%nMessage: %s%n" --date=short

Length of output: 4546


@hasit Here's a summary of the last 20 commits on the main branch:

📊 Commit Summary (Nov 13 - Dec 10, 2025)

🎯 Recent Features (December 2025)

  1. Copy command (feat: add copy command for syncing files between worktrees #39) - New command for syncing files between worktrees
  2. Declarative configuration (feat: add .gtrconfig file for declarative configuration #38) - Added .gtrconfig file support
  3. .worktreeinclude file support (feat: add .worktreeinclude file support #28) - Enhanced file inclusion capabilities
  4. --from-current flag (feat: add --from-current flag and fix zsh completions #25) - New flag with zsh completions fixes
  5. Run command (Add run command to execute commands in worktrees #24) - Execute commands across worktrees
  6. Directory copying (Add directory copying to avoid reinstalling dependencies #23) - Avoid reinstalling dependencies when creating worktrees

🔧 Bug Fixes

🤖 Adapter Additions

📚 Documentation

🏷️ Version Milestones

⚙️ Project Infrastructure

Key contributors: Tom Elizaga, Nato Boram, Ed Harrod, Hiroki Nakashima, Ryodai Ueyama, and others.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 6e3b6cd and 2ec73e9.

📒 Files selected for processing (1)
  • .coderabbit.yaml (1 hunks)
🔇 Additional comments (1)
.coderabbit.yaml (1)

19-25: Well-structured shell-check custom pre-merge rule.

The new custom check is properly configured with appropriate mode set to "error" to enforce shell script quality standards. The instructions clearly specify that shell scripts must be syntactically valid and provide examples for multiple shells (bash, zsh, fish, etc.), which aligns well with the PR's goal of improving Fish shell support.

Comment on lines +19 to +25
pre_merge_checks:
custom_checks:
- mode: error
name: shell-check
instructions: |
- Always check if the shell scripts are valid and sytactically correct.
- Make sure there are examples for all the supported shells, such as bash, zsh, fish, etc.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix typo in instruction text.

Line 24 contains a spelling error: "sytactically" should be "syntactically".

-          - Always check if the shell scripts are valid and sytactically correct.
+          - Always check if the shell scripts are valid and syntactically correct.
🤖 Prompt for AI Agents
In .coderabbit.yaml around lines 19 to 25, fix the spelling error in the
custom_checks instructions: replace "sytactically" with "syntactically" in the
sentence "- Always check if the shell scripts are valid and sytactically
correct." so the line reads "- Always check if the shell scripts are valid and
syntactically correct."

@hasit hasit closed this Dec 10, 2025
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.

1 participant