Skip to content

docs: document '.' as target for current worktree removal#20

Merged
Jercik merged 1 commit intomainfrom
docs/dot-target-current-worktree
Mar 4, 2026
Merged

docs: document '.' as target for current worktree removal#20
Jercik merged 1 commit intomainfrom
docs/dot-target-current-worktree

Conversation

@Jercik
Copy link
Copy Markdown
Owner

@Jercik Jercik commented Mar 4, 2026

Summary

  • Add test case for . input resolving to the current worktree in resolve-worktree-target.test.ts
  • Document . as a supported target format in the README (Manual Mode section and Examples)

The path resolution already supports . to remove the current worktree (worktree-remove . --yes), but it was untested and undiscoverable.

Test plan

  • pnpm test passes (54 tests, including the new one)

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Approach Review: Approach looks good. Documenting existing functionality and adding test coverage for . as a target is the right way to make this feature discoverable. No alternative approach needed.


Approach review by Claude (opus)

The path resolution already supports '.' to target the current worktree,
but it was untested and undiscoverable. Add a test case and document it
in the README so users know they can run `worktree-remove . --yes`.
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Approach Review: approach looks good


Approach review by Codex CLI (gpt-5.3-codex)

@Jercik Jercik force-pushed the docs/dot-target-current-worktree branch from a737752 to de7b410 Compare March 4, 2026 04:39
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Summary: Found 1 high issue.


Code review by Codex CLI (gpt-5.3-codex)

Comment thread package.json
"devDependencies": {
"@total-typescript/ts-reset": "^0.6.1",
"@types/node": "^25.3.1",
"@types/node": "^25.3.3",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 High: package.json updates @types/node and eslint-config-axkit, but pnpm-lock.yaml was not updated in this PR. This fails reproducibly with npx -y pnpm@10.30.3 install --frozen-lockfile (ERR_PNPM_OUTDATED_LOCKFILE, mismatched specifiers for both deps). I also checked .github/workflows/checks.yml and .github/workflows/release.yml, and both run pnpm install --frozen-lockfile, so CI/release installs will fail until the lockfile is regenerated and committed.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Approach Review: Approach looks good.


Approach review by Gemini (gemini-3.1-pro-preview)

Copy link
Copy Markdown
Owner Author

@Jercik Jercik left a comment

Choose a reason for hiding this comment

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

Approach Review: The approach of adding a focused regression test for . resolution and documenting it is the right fix for the ‘works but undiscoverable’ problem. A potentially more discoverable alternative is to also add the worktree-remove . --yes example (or mention . as a supported target) in the CLI --help text, since that’s where users typically look first.


Approach review by Copilot (gpt-5.2)

Comment thread README.md
- branch name (for worktrees on a branch)
- worktree path (works for detached HEAD worktrees)
- directory name in the parent folder (useful when there's no branch)
- `.` (current directory — removes the worktree you are in)
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Alternative approach: Consider also documenting . in the CLI --help output (e.g., add worktree-remove . --yes to the help examples / target description in src/cli.ts) to improve discoverability for users who never read the README.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Summary: No issues found after reviewing the diff and related integration points.


Code review by Codex CLI (gpt-5.3-codex)

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a7377527db

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread package.json
Comment on lines +69 to +72
"@types/node": "^25.3.3",
"@vitest/coverage-v8": "^4.0.18",
"eslint": "^10.0.2",
"eslint-config-axkit": "^1.3.0",
"eslint-config-axkit": "^1.4.0",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Update pnpm lockfile after dependency version bumps

These dependency specifier bumps are not accompanied by a pnpm-lock.yaml update, so CI will fail in this repo’s install step because the workflow enforces pnpm install --frozen-lockfile (.github/workflows/checks.yml:27). The lockfile importer still records @types/node as ^25.3.1 and eslint-config-axkit as ^1.3.0 (pnpm-lock.yaml:34,43), which no longer matches package.json, making the lockfile out of date for this commit.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Summary: Clean PR — docs and test accurately reflect existing behavior. No issues found.


Code review by Claude (opus)

it("resolves current directory when input is '.'", () => {
const result = resolveWorktreeTarget({
input: ".",
cwd: "/Users/acme/repo-feature/foo",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ℹ️ Info: Good test — it confirms that looksLikePathInput(".") returns true (line starts with "."), causing path.resolve(cwd, ".") to produce the cwd itself, which then matches the registered worktree.

Worth noting: this covers the case where cwd is the worktree root. If a user runs worktree-remove . from a subdirectory (e.g., repo-feature/foo/src), the resolved path wouldn't match the worktree root and would fall through to the candidates path — potentially treating the subdirectory as an orphaned directory. That's pre-existing behavior and outside this PR's scope, but could be worth a follow-up test or guard if it comes up.

Comment thread README.md
- branch name (for worktrees on a branch)
- worktree path (works for detached HEAD worktrees)
- directory name in the parent folder (useful when there's no branch)
- `.` (current directory — removes the worktree you are in)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ℹ️ Info: Nice addition. The parenthetical description is clear and consistent with the style of the other bullet points above.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Summary: No issues found. Clean PR — documentation accurately describes existing behavior, test correctly verifies . resolution, and dependency bumps are minor dev-only patches.


Code review by Claude (opus)

});
});

it("resolves current directory when input is '.'", () => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ℹ️ Info: Good test coverage for the . input case. The test correctly verifies that "." resolves via path.resolve(cwd, ".") to the current directory, matches the registered worktree at that path, and returns isPathInput: true (since looksLikePathInput() returns true for inputs starting with .). The test data is well-structured with a distinct cwd that differs from mainPath, ensuring the resolution is actually using the cwd rather than defaulting.

@Jercik Jercik merged commit 780fdd5 into main Mar 4, 2026
5 checks passed
@Jercik Jercik deleted the docs/dot-target-current-worktree branch March 4, 2026 04:49
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.4.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant