Commit log

66cd038 fix(init): preserve untracked/ignored files

Click to expand commit body
Previously, wt init would delete globally-ignored and untracked files
from the project root after creating the worktree. Since git worktree
add only creates tracked files, these files were permanently lost.

Now wt init:
- Uses git status --porcelain=v1 -z --ignored=matching to detect all
file states
- Aborts only on tracked modifications (staged/unstaged changes)
- Copies untracked and ignored files to the worktree before cleanup
- Checks for destination conflicts to prevent overwriting tracked files
- Properly quotes all shell arguments to handle special characters

Assisted-by: Claude Opus 4.5 via Amp

Amolith created

2b592eb fix(path): prefix child paths with ./

Click to expand commit body
Assisted-by: Claude Opus 4.5 via Amp

Amolith created

cded6e8 docs: update AGENTS.md for modular structure

Click to expand commit body
- Document src/wt/ module structure with cmd/ subdirectory
- Add make dist/install commands and bundling workflow
- Update testing section with actual patterns from spec/
- Consolidate non-obvious behaviors; remove outdated info
- Remove utility function list (agents discover via requires)

Assisted-by: Claude Opus 4.5 via Crush

Amolith created

0f27ea6 fix(cmd): resolve type checker nil warnings

Click to expand commit body
Add ---@cast annotations in clone.lua and new.lua where the type checker
couldn't infer that loop-bounded array access returns non-nil.

Add early return after shell.die() in add.lua so type checker knows file
handle is non-nil when close() is called.

Assisted-by: Claude Opus 4.5 via Amp

Amolith created

f270fe5 fix(cmd): allow flags anywhere in argument list

Click to expand commit body
Refactored argument parsing in add, clone, and new commands to use a
for-loop pattern that collects flags and positional args separately.
This allows POSIX-style flexible flag positioning (e.g., `wt a -b
branch` works the same as `wt a branch -b`).

Also adds @cast annotations after validation to satisfy the type
checker.

Assisted-by: Claude Opus 4.5 via Amp

Amolith created

83f78b6 feat(add): improve UX with idempotency and hints

Click to expand commit body
- Make wt a idempotent: succeed if worktree exists for branch
- Validate existing worktree path (detect stale entries)
- Warn if existing path differs from current config
- Friendlier orphan branch error with actionable message
- Add hint for multiple remotes case
- Improve hook skip warning to be more actionable

Add helper functions to git.lua:
- ref_has_commits() for orphan detection
- find_worktree_by_branch() for idempotency check

Assisted-by: Claude Opus 4.5 via Amp

Amolith created

88bd695 fix(bundle): use literal bracket in delimiter

Click to expand commit body
Assisted-by: Claude Opus 4.5 via Amp

Amolith created

d3359e2 feat(remove): cleanup empty parent directories

Click to expand commit body
After removing a nested worktree like feature/auth/oauth2, removes the
now-empty parent directories up to project root.

Assisted-by: Claude Opus 4.5 via Amp

Amolith created

011a9b6 feat(add): default start-point to source branch

Click to expand commit body
When using -b from inside a worktree without specifying a start-point,
defaults to the current worktree's branch.

Assisted-by: Claude Opus 4.5 via Amp

Amolith created

f443715 feat(hooks): forward run hook stdout to user

Click to expand commit body
Allows hooks to emit reminders or messages during worktree creation.

Assisted-by: Claude Opus 4.5 via Amp

Amolith created

1c52896 fix(fetch): exit 0 on partial remote failure

Click to expand commit body
Previously exited non-zero if ANY remote failed, even when others
succeeded. Now fetches each remote individually, prints warnings for
failures, and exits 0 if at least one remote succeeded.

Assisted-by: Claude Opus 4.5 via Amp

Amolith created

813b397 fix(init): add warnings for file deletion

Click to expand commit body
- Add prominent warning listing files that will be deleted from root
- Clarify that files are preserved in the new worktree
- Improve dirty repo error with complete stash/pop workflow hint

Assisted-by: Claude Opus 4.5 via Amp

Amolith created

a041fa1 docs(clone): clarify push behavior for modes

Click to expand commit body
Contributor mode pushes to all selected remotes (fork copies). Own mode
pushes only to additional remotes (mirrors), not the first.

Assisted-by: Claude Opus 4.5 via Amp

Amolith created

9cbd44b build: add install target

Amolith created

c507fc6 fix(wt): resolve type checker warnings

Click to expand commit body
- Add GlobalConfig type annotation in config.lua with typed fields
- Type remotes values as string? to allow nil lookups
- Replace local aliases with direct module exports in main.lua
- Suppress duplicate-set-field for test API re-exports
- Suppress unnecessary-if for union type discrimination
- Use explicit if-narrowing for global_config.remotes

Assisted-by: Claude Opus 4.5 via Amp

Amolith created

1d8edee refactor(wt): extract cmd.init module

Click to expand commit body
Assisted-by: Claude Opus 4.5 via Amp

Amolith created

d76c1dd refactor(wt): extract cmd.clone module

Click to expand commit body
Assisted-by: Claude Opus 4.5 via Amp

Amolith created

a6f99dc refactor(wt): extract cmd.new module

Click to expand commit body
Assisted-by: Claude Opus 4.5 via Amp

Amolith created

96856da refactor(wt): extract cmd.add module

Click to expand commit body
Assisted-by: Claude Opus 4.5 via Amp

Amolith created

7fd0c44 refactor(wt): extract cmd.remove module

Click to expand commit body
Assisted-by: Claude Opus 4.5 via Amp

Amolith created

9653af1 chore: use test-quiet in make all

Amolith created

ac940cb refactor(wt): extract cmd.list module

Click to expand commit body
Assisted-by: Claude Opus 4.5 via Amp

Amolith created

a2f02e2 refactor(wt): extract cmd.fetch module

Click to expand commit body
Assisted-by: Claude Opus 4.5 via Amp

Amolith created

7416196 refactor(wt): extract help module

Click to expand commit body
Assisted-by: Claude Opus 4.5 via Amp

Amolith created

b1c03af refactor(wt): extract hooks module

Click to expand commit body
Create src/wt/hooks.lua with load_hook_permissions,
save_hook_permissions, summarize_hooks, check_hook_permission, and
run_hooks functions. Update main.lua to import from the new module.

Assisted-by: Claude Opus 4.5 via Amp

Amolith created

94be68f refactor(wt): extract config module

Click to expand commit body
Assisted-by: Claude Opus 4.5 via Amp

Amolith created

01f8db0 refactor(wt): extract git module

Click to expand commit body
Assisted-by: Claude Opus 4.5 via Amp

Amolith created

e60790a refactor(wt): extract path module

Click to expand commit body
Assisted-by: Claude Opus 4.5 via Amp

Amolith created

855df08 refactor(wt): extract shell module

Click to expand commit body
Assisted-by: Claude Opus 4.5 via Amp

Amolith created

a654886 refactor(wt): extract exit module

Click to expand commit body
Assisted-by: Claude Opus 4.5 via Amp

Amolith created

badc7eb fix: add type annotations for lx check

Click to expand commit body
Assisted-by: Claude Opus 4.5 via Amp

Amolith created

3b2c3b2 test: suppress git noise and add quiet test target

Click to expand commit body
- Add spec/test_helper.lua with git() function that configures
init.defaultBranch, user.email, user.name, and advice.detachedHead to
suppress hints and warnings while preserving real errors
- Update spec files to use the helper
- Add make test-quiet target that shows full output only on failure

Assisted-by: Claude Opus 4.5 via Amp

Amolith created

32b1884 build: add bundle script and dist target

Click to expand commit body
Adds infrastructure for splitting src/main.lua into modules while
preserving the single-file curl installation story.

- scripts/bundle.lua concatenates modules into dist/wt
- Makefile gains 'dist' and 'clean' targets
- README updated to curl from dist/wt

Assisted-by: Claude Opus 4.5 via Amp

Amolith created

8198c5d feat(wt): moar help text!

Click to expand commit body
Assisted-by: Claude Opus 4.5 via Amp

Amolith created

6c7293f fix: move licence header down

Amolith created

5006127 docs(installation): move gum mention up

Amolith created

e07ca35 docs(contributions): correct URL

Amolith created

591261b chore(licence): add allllll the info

Amolith created

252a19a docs(badge): fix liberapay image

Amolith created

d84a608 fix: report config parsing errors

Click to expand commit body
Previously, syntax errors in config files were silently ignored, causing
confusing behavior (e.g. "remote 'github' not found").

Both load_global_config and load_project_config now:
- Try loading with and without implicit return
- Report syntax errors with line numbers
- Report execution errors (e.g. undefined variables)
- Report when config doesn't return a table

Assisted-by: Claude Opus 4.5 via Amp

Amolith created

fd796c0 feat: implement wt worktree manager

Click to expand commit body
A CLI tool for managing git worktrees with a bare repository structure.

Commands:
- init: Convert existing repo to bare + worktree structure
- n/c: Clone repo into bare + worktree structure
- a: Add new worktree for branch
- r: Remove worktree (optionally delete branch)
- l: List worktrees
- f: Fetch and prune all remotes

Features:
- Global config for path styles, remotes, and defaults
- Project-level hooks (copy, symlink, run) for new worktrees
- Hook permission system with per-project approval
- Support for nested and flat branch path styles
- Multiple remote management for own/contributing workflows
- Dry-run mode for init command

Amp-Thread: https://ampcode.com/threads/T-019bcdca-a9c9-73ee-ac7c-8fbb2d10ef02
Amp-Thread: https://ampcode.com/threads/T-019bcde6-c4c6-71fa-a593-9913c2072f27
Amp-Thread: https://ampcode.com/threads/T-019bcdec-7940-723b-9f20-cd5cf8eab286
Amp-Thread: https://ampcode.com/threads/T-019bcde2-434f-722c-8b1d-0d4788f16c22
Amp-Thread: https://ampcode.com/threads/T-019bcdf0-fddd-71e8-b732-250b6adaeaba
Amp-Thread: https://ampcode.com/threads/T-019bcdf9-c281-76cc-be06-8762039c75f9
Amp-Thread: https://ampcode.com/threads/T-019bce01-6ba3-74fc-9950-0d54b95adb7a
Amp-Thread: https://ampcode.com/threads/T-019bce05-b956-7599-a0be-ebdf73acdcb6
Amp-Thread: https://ampcode.com/threads/T-019bce08-580e-73eb-a55c-63253b7ab599
Amp-Thread: https://ampcode.com/threads/T-019bce1b-11b4-718c-91b8-cd36f34f3aa4
Amp-Thread: https://ampcode.com/threads/T-019bce1f-dbff-7369-8f2b-59d7f6a09d0d
Amp-Thread: https://ampcode.com/threads/T-019bce26-10b6-747b-a364-0ab2fb74c1f6
Amp-Thread: https://ampcode.com/threads/T-019bce2b-b03a-74cd-9161-d0775b3df8a3
Amp-Thread: https://ampcode.com/threads/T-019bce2d-1c3c-748d-a19a-4378098c2ef0
Amp-Thread: https://ampcode.com/threads/T-019bce3f-cf1a-74a2-8d59-01966ebdf4c7
Amp-Thread: https://ampcode.com/threads/T-019bcdd2-12ee-70af-b4ab-5cbb7fc9a4d0
Amp-Thread: https://ampcode.com/threads/T-019bce4e-2986-775c-aff9-ad4a71f85ff0
Amp-Thread: https://ampcode.com/threads/T-019bce51-c314-75c5-82c7-aa75414d09cb
Amp-Thread: https://ampcode.com/threads/T-019bce65-5a4b-747a-a89c-f41b4b6bf06a
Amp-Thread: https://ampcode.com/threads/T-019bce69-0848-702c-8379-12dc822ad659
Amp-Thread: https://ampcode.com/threads/T-019bce79-2cdc-76ed-8608-81587e612f54
Amp-Thread: https://ampcode.com/threads/T-019bce80-071c-71ac-b7f9-39d5507b0352
Amp-Thread: https://ampcode.com/threads/T-019bce8a-cefc-77da-9598-5a7e8a99ed9a
Assisted-by: Claude Opus 4.5 via Amp

Amolith created

2859e1f initial commit

Click to expand commit body
Amp-Thread-ID: https://ampcode.com/threads/T-019bce08-580e-73eb-a55c-63253b7ab599
Co-authored-by: Amp <amp@ampcode.com>

Amolith and Amp created