Skip to content

Conversation

@coderabbitai
Copy link

@coderabbitai coderabbitai bot commented Oct 13, 2025

Docstrings generation was requested by @felipeS.

The following files were modified:

  • src/commands/setup.ts
  • src/utils/git.ts
These file types are not supported
  • README.md
ℹ️ Note

CodeRabbit cannot perform edits on its own pull requests yet.

Docstrings generation was requested by @felipeS.

* #22 (comment)

The following files were modified:

* `src/commands/setup.ts`
* `src/utils/git.ts`
@coderabbitai
Copy link
Author

coderabbitai bot commented Oct 13, 2025

Important

Review skipped

CodeRabbit bot authored PR detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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

johnlindquist added a commit that referenced this pull request Dec 7, 2025
- Add detailed docstring to setupWorktreeHandler explaining parameters and behavior
- Add docstring to isMainRepoBare function
- Add docstring to getRepoRoot function

Integrates documentation improvements from PR #23 by @coderabbitai
@johnlindquist
Copy link
Owner

Superseded by PR #30 which integrates the docstrings along with other fixes. Thank you @coderabbitai!

@coderabbitai
Copy link
Author

coderabbitai bot commented Dec 7, 2025

Tip

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

@johnlindquist: You're very welcome! I'm glad the docstrings work has been integrated into PR #30 along with the other improvements. Thank you for keeping me in the loop, and best of luck with the consolidated changes! 🚀

    (\(\
    ( -.-)
    o_(")(")
    Happy to help!

🧠 Learnings used
Learnt from: CR
Repo: johnlindquist/worktree-cli PR: 0
File: .cursor/rules/project.mdc:0-0
Timestamp: 2025-08-04T13:02:29.847Z
Learning: Applies to src/commands/new.ts : Implement logic for creating new Git worktrees, including options for branch creation, dependency installation, and opening in an editor, in src/commands/new.ts.

Learnt from: CR
Repo: johnlindquist/worktree-cli PR: 0
File: .cursor/rules/project.mdc:0-0
Timestamp: 2025-08-04T13:02:29.847Z
Learning: Applies to src/commands/list.ts : Provide functionality to list existing Git worktrees in src/commands/list.ts.

Learnt from: CR
Repo: johnlindquist/worktree-cli PR: 0
File: .cursor/rules/project.mdc:0-0
Timestamp: 2025-08-04T13:02:29.847Z
Learning: Applies to src/commands/remove.ts : Handle removal of Git worktrees, including support for force deletion, in src/commands/remove.ts.

johnlindquist added a commit that referenced this pull request Dec 7, 2025
* fix: Address issues #27, #28, #29

- #27: Editor 'none' now skips opening editor instead of failing
  Added shouldSkipEditor() to config.ts and updated all command handlers
  to check for 'none' value before attempting to open editor

- #28: wt new without branch name now shows clear error
  Added validation at start of newWorktreeHandler to require branch name

- #29: build/index.js now has execute permissions after build
  Added postbuild script to package.json that runs chmod +x

Also updated .gitignore to exclude .beads/ and .vscode/ directories

* feat: Add GitLab support for pr command (PR #26)

- Auto-detect git provider from remote URL (github.com or gitlab.com)
- Add config option: wt config set provider gh|glab
- Adapt pr command to work with both GitHub PRs and GitLab MRs
- Update error messages to be provider-specific (PR vs MR, GitHub vs GitLab)
- Add detectGitProvider function to git.ts
- Add getGitProvider/setGitProvider to config.ts

The tool automatically detects the provider from the remote URL.
Manual configuration is available as fallback via config command.

Backward compatible: defaults to gh (GitHub CLI) maintaining existing behavior.

Integrates PR #26 by @Cl3MM

* feat: Add configurable default worktree directory (PR #24)

- Add defaultWorktreePath config option
- Add wt config set worktreepath <path> command
- Add wt config get worktreepath command
- Add wt config clear worktreepath command (reverts to sibling behavior)
- Update new, setup, pr, and extract commands to use configured path
- Support ~ expansion in path (expands to home directory)

Path resolution priority:
1. --path flag (highest priority)
2. defaultWorktreePath config setting
3. Sibling directory behavior (default fallback)

Example:
  wt config set worktreepath ~/worktrees
  wt new feature/login -> creates ~/worktrees/login

Integrates PR #24 by @trevortrinh

* docs: Add JSDoc comments to key functions (PR #23)

- Add detailed docstring to setupWorktreeHandler explaining parameters and behavior
- Add docstring to isMainRepoBare function
- Add docstring to getRepoRoot function

Integrates documentation improvements from PR #23 by @coderabbitai

* docs: Update README with new features

- Document GitLab support for wt pr command
- Document editor 'none' option to skip opening
- Document git provider configuration
- Document configurable default worktree directory
- Update requirements section

* feat: Add --setup flag to wt pr command (closes #25)

- Create shared runSetupScripts utility in src/utils/setup.ts
- Add -s, --setup option to pr command
- Execute setup scripts from worktrees.json or .cursor/worktrees.json
- Update README with --setup documentation

This allows users to run setup scripts when creating a worktree from a PR/MR:
  wt pr 123 --setup

* fix: Address CodeRabbit PR feedback

- Fix GitLab MR branch lookup: use -o json instead of -F json
- Add JSON parse error handling for clearer error messages
- Improve GitLab detection: parse hostname properly instead of includes()
- Fix magic string check: use hasWarnedAboutCheckout flag instead
- Remove redundant default: undefined from config schema
- Add HOME/USERPROFILE validation for tilde expansion
- Make postbuild script cross-platform (works on Windows)
- Add JSDoc documentation for detectGitProvider and getRemoteHostname
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.

2 participants