Commit Graph

1003 Commits

Author SHA1 Message Date
Maximilian Roos 9df3fbbf70 Add wt step for-each command for multi-worktree operations (#138)
Add experimental command to run commands across all worktrees sequentially.
Canonical use case: `wt step for-each -- git pull --autostash`

Features:
- Template variables: {{ branch }}, {{ worktree }}, {{ commit }}, etc.
- JSON context piped to stdin for scripts
- Continues on failure, reports summary at end
- Proper exit code (1) when any worktree fails

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-10 16:20:58 -08:00
Maximilian Roos 3bbd168ba4 Add Contributing section to README and social icons to docs footer (#131)
- Add Contributing section to README with star, feedback, feature request,
  and share links
- Add social icon buttons to docs footer (GitHub, Crates.io, X, Reddit,
  LinkedIn) replacing redundant text links
- Move FAQ "How can I contribute?" section to bottom of page
- Update share links to point to worktrunk.dev instead of GitHub

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-10 11:47:04 -08:00
Maximilian Roos b2fe218333 docs(faq): Add Windows support FAQ entry (#129)
Document experimental Windows support with feature matrix comparing
Git Bash vs PowerShell. Explains that wt select is unavailable (skim
is Unix-only), hooks require Git Bash, and core commands work in both
shells.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-10 10:44:56 -08:00
Maximilian Roos b7b1b9e3c8 Move approvals command from config to hook
The `approvals` subcommand logically belongs under `wt hook` since it manages approval of hook commands. This reorganizes the CLI structure to group related functionality together. Users should now use `wt hook approvals add/clear` instead of `wt config approvals add/clear`.
2025-12-10 03:12:39 -08:00
Maximilian Roos 762428960e Clarify log preview dimming of commits on main branch
Update the help text and format string to better describe that commits
already on the main branch appear with dimmed hashes in the log preview.
Also adjust the format string to ensure the hash dimming is applied
correctly before the commit message.
2025-12-09 23:58:37 -08:00
Maximilian Roos 04611524c1 Rename preview mode "history" to "log"
Update preview tab 2 label from "history" to "log" across documentation,
CLI help text, enum definitions, function names, and test cases. Also
rename the corresponding snapshot file to match the new test function name.
2025-12-09 23:38:29 -08:00
Maximilian Roos 107591b30b Simplify default LLM prompt templates
Refactor commit message prompts to be more concise and clearer. Replace verbose format/style explanations with structured XML-like tags and imperative mood guidance. Consolidate template examples and reduce redundant instructions.

Updates default templates in src/llm.rs and syncs changes to config example and documentation files along with related test snapshots.
2025-12-09 23:03:36 -08:00
Maximilian Roos b2048db58a feat: Add user-level hooks that run for all repositories, add wt hook show (#118)
* feat: Add user-level hooks that run for all repositories

Implement a new user hooks system that allows developers to define
personal hooks in `~/.config/worktrunk/config.toml` that execute for
all repositories. User hooks complement project hooks with these key
differences:

- **Scope**: Run for all repositories (vs. single repository)
- **Location**: User config file (vs. `.config/wt.toml`)
- **Approval**: Not required (user implicitly approves via config)
- **Execution order**: Run before project hooks
- **Skip behavior**: Skipped together with project hooks via `--no-verify`

### Implementation Details

**Configuration syntax** (same as project hooks):
```toml
[post-create]
setup = "echo 'Setting up worktree...'"

[pre-merge]
notify = "notify-send 'Merging {{ branch }}'"
```

**Hook types supported**: post-create, post-start, pre-commit, pre-merge,
post-merge, pre-remove

**Template variables**: Support all project hook variables plus `remote_url`
for repository-specific conditional logic

**New data structures**:
- `HookSource` enum: Distinguishes user vs. project hooks
- `prepare_user_commands()`: Expands user hook templates without approval

**Updated hook pipeline**:
- `HookPipeline::run_sequential()`: Accepts `HookSource` instead of
  `phase` and `label_prefix`
- `HookPipeline::spawn_background()`: Renamed from `spawn_detached()` for
  consistency

### Documentation Updates

- Updated help text and documentation to clarify `--no-verify` skips all
  hooks (both user and project)
- Added "User hooks" section to config documentation with examples
- Added comparison table showing key differences from project hooks
- Added use cases and filtering examples

### Tests

Added comprehensive integration test suite (`tests/integration_tests/user_hooks.rs`)
covering:
- Basic execution of all hook types
- Execution order (user before project)
- No approval required for user hooks
- `--no-verify` skips all hooks
- Failure handling and behavior
- Template variable expansion
- Background hook execution
- Combined user and project hook scenarios

* Refine hooks: document remote_url, consolidate check

- Document remote_url template variable in cli.rs (syncs to docs)
- Move check_any_hook_configured into run_hook_with_filter
- Simplify standalone hook match arms

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Update snapshots for symmetric project hook labeling

Project hooks now show "project" prefix (e.g., "Running project pre-merge")
for consistency with user hook labeling.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Update docs to reflect user hooks in all hook references

- wt hook intro: Mention both user and project hooks
- --no-verify: Change "skip project hooks" to "skip all hooks"
- User config comment: Clarify verify skips all hooks

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Add `wt hook show` command to display configured hooks with approval status

Adds a new `show` subcommand to `wt hook` that displays all configured hooks
from both user and project config files with their approval status. Project
hooks show a ❓ indicator when they require approval.

Features:
- Lists hooks organized by type (post-create, post-start, pre-commit, etc.)
- Shows both user-level hooks (run for all repos) and project-specific hooks
- Displays approval status for project hooks (❓ = needs approval)
- Optional `--expanded` flag to show template variables substituted with current context
- Optional hook type filter to show only specific hook types
- Output is displayed through a pager (like git help) when available

Also reorders hook subcommands to put `show` first, making hook inspection
the primary entry point before hook execution commands.

* feat: Add user-level hooks that run for all repositories

Personal hooks in ~/.config/worktrunk/config.toml now run automatically
before project hooks for all worktree operations. User hooks don't require
approval and use the same syntax and template variables as project hooks.

Changes:
- Add user hook support for all hook types (post-create, post-start,
  pre-commit, pre-merge, post-merge, pre-remove)
- User hooks run before project hooks in execution order
- Skip all hooks with --no-verify (applies to both user and project)
- Add remote_url template variable for repository-aware filtering
- Update documentation and help text to reflect user hooks
- Refine hook labeling to distinguish "user" vs "project" hooks in output
- Add comprehensive integration tests for user hook functionality

* feat: Add user-level hooks and improve hook infrastructure

User hooks enable personal, repository-agnostic automations while maintaining
team standards via project hooks. Key improvements:

- User hooks defined in ~/.config/worktrunk/config.toml run before project hooks
- User hooks don't require approval (user implicitly approves by defining them)
- Post-start logs now include source prefix to avoid collisions (user/project)
- remote_url template variable added for conditional hook logic
- Hook output labels distinguish user vs project hooks for clarity
- All hooks skipped together via --no-verify flag
- --no-verify help text simplified from "Skip project hooks" to "Skip hooks"

Implementation:
- HookSource enum tracks whether hooks are user or project
- prepare_user_commands() handles user hooks (no approval needed)
- Hook pipeline shows source in output: "Running user pre-merge" vs "Running project pre-merge"
- Background operation names include source to prevent log file collisions

* feat: support SSH URLs and improve branch name escaping

Add support for ssh:// URL format in git remote parsing to handle
SSH URLs alongside existing git@ and https:// formats.

Improve branch name escaping for git config keys by using hex encoding
(-XX format) instead of percent-encoding, ensuring all non-alphanumeric
characters (except . and -) are properly escaped. This handles UTF-8
multi-byte sequences and enables reliable round-trip encoding/decoding
of branch names containing /, _, and other special characters.

* feat: Add user-level hooks and improve hook infrastructure

User hooks enable personal, repository-agnostic automations while maintaining
team standards via project hooks. Key improvements:

- User hooks defined in ~/.config/worktrunk/config.toml run before project hooks
- User hooks don't require approval (user implicitly approves by defining them)
- Post-start logs now include source prefix to avoid collisions (user/project)
- remote_url template variable added for conditional hook logic
- Hook output labels distinguish user vs project hooks for clarity
- All hooks skipped together via --no-verify flag
- --no-verify help text simplified from "Skip project hooks" to "Skip hooks"

Implementation:
- HookSource enum tracks whether hooks are user or project
- prepare_user_commands() handles user hooks (no approval needed)
- Hook pipeline shows source in output: "Running user pre-merge" vs "Running project pre-merge"
- Background operation names include source to prevent log file collisions

* Fix pre-remove hook approval with "Approve at the Gate" pattern

The pre-remove hook execution was incorrectly using auto_trust=true,
bypassing approval prompts. This commit introduces a design pattern
where approval happens exactly once at command entry points:

- Add collect_and_approve_hooks() helper for upfront approval
- wt remove now approves pre-remove hooks before any execution
- Add --force flag to skip approval prompts
- Thread auto_trust parameter through handle_remove_output

The pattern ensures approval happens at the "gate" (command entry),
eliminating error-prone threading of auto_trust through execution layers.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Remove pending snapshot file from statusline tests

The .statusline.rs.pending-snap file is no longer needed and should not be committed to version control.

* Implement "Approve at the Gate" pattern for all project hooks

Moves approval prompts to command entry points instead of hook execution.
Commands are now approved once in a batch before any hooks run, with template
expansion so users see actual values (branch names, paths) instead of
placeholders. This eliminates redundant prompts and simplifies the execution
layer by removing the `auto_trust` parameter threading.

Key changes:
- Rename `collect_and_approve_hooks()` to `collect_and_approve_hooks_with_context()`
  and add `expand_commands_for_approval()` for showing expanded templates in prompts
- Remove `auto_trust` parameter from hook execution functions
- Simplify `HookSource::Project` enum variant (no longer carries approval state)
- Add gate approval at `wt switch --create`, `wt remove`, `wt step commit/squash`
- Update merge command collection to expand templates before approval batch
- Remove binary `rust_out` artifact and test snapshot file

* Clarify hook command runs on demand for testing and CI

Update documentation and help text to better explain that `wt hook`
runs hooks independently of normal worktree operations. Changes emphasize
the use cases (testing, CI, re-running after failure) rather than
describing it as "manually" running hooks.

Also simplify phrasing around user hooks and remove unnecessary markdown
formatting for consistency.

* Rename approval and hook functions to simpler names

Update function names to be more concise and consistent:
- `collect_and_approve_hooks_with_context()` → `approve_hooks()`
- `handle_standalone_run_hook()` → `run_hook()`
- `handle_standalone_commit()` → `step_commit()`
- `handle_standalone_add_approvals()` → `add_approvals()`
- `handle_standalone_clear_approvals()` → `clear_approvals()`

Also update documentation examples to reference the new names.

* Handle declined command approvals by skipping hooks while continuing operations

When users decline command approval, hooks are now skipped but the operation
proceeds. This applies consistently across all approval gates: merge, commit,
squash, remove, and hook execution.

Previously, declined approvals would still attempt hook execution. Now, the
verify flag is shadowed based on approval result - if declined, verify becomes
false to gate all subsequent hook execution. For explicit hook runs via
`wt hook`, a declined approval returns early since the entire purpose is hook
execution.

This ensures users have clear control: approving runs hooks, declining skips
them but continues the workflow.

* Fix wt hook approval: filter by name and use consistent target branch

Two fixes for `wt hook` command:

1. Pass name_filter to approval so `wt hook pre-merge --name foo` only
   prompts for approval of the "foo" hook, not all hooks of that type.
   Added `approve_hooks_filtered()` function that accepts optional name
   filter parameter.

2. Use current branch as target for pre-merge/post-merge approval prompts
   to match execution. Previously approval used default_branch while
   execution used current branch, showing misleading command expansions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix wt hook show --expanded to expand {{ target }} for merge/commit hooks

The expand_command_template function now passes hook-specific extra vars:
- PreCommit: target = default branch (for comparison context)
- PreMerge/PostMerge: target = current branch (matches run_hook behavior)

Previously, --expanded would show raw {{ target }} placeholders for these
hook types because extra_vars was always empty.

Also added TODO for pre-remove approval context issue: when removing
another worktree, the approval preview uses current worktree context
instead of the target worktree context.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-09 20:57:46 -08:00
Maximilian Roos 181fb531a4 Clarify approvals docs (#120)
* Clarify approvals docs

* Fix fish-style directory test on Windows

Unix-style absolute paths like `/tmp/test` are not recognized as absolute
on Windows, causing the test to fail. Guard these assertions with #[cfg(unix)].

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-09 19:19:13 -08:00
Maximilian Roos 5053af8808 Reorganize status column symbols for better scannability
The status column previously mixed operational concerns (git conflicts,
rebase, merge) with relationship information (main divergence, worktree
location). This reorganization groups related symbols:

- Worktree position 3: operation and location state (conflicts ✘⤴⤵ take
  priority over location /⚑⊟⊞)
- Main position 4: relationship to main branch (^✗_⊂↕↑↓, single-stroke arrows)
- Remote position 5: relationship to tracking branch (|⇅⇡⇣, double-stroke arrows)

This grouping reduces cognitive load by keeping related symbols adjacent.
Operations now correctly display regardless of integration state, and the
main column clearly shows branch relationship independent of changes.

JSON field renames reflect the reorganized semantics:
- `branch_state` → split into `main_state` and `operation_state`
- Downstream jq queries use `.operation_state` for conflicts
- Statusline output reordered to match position grid
2025-12-09 18:39:39 -08:00
Maximilian Roos 4d97ac1f53 Fix docs for approvals and post-merge timing (#119) 2025-12-09 18:32:04 -08:00
Maximilian Roos fe981c2e5d feat: enable help text wrapping for better readability
Add `wrap_help` feature to clap and `terminal_size` dependency to enable
automatic wrapping of help text based on terminal width. This improves
readability of long help descriptions by breaking them across multiple lines
instead of displaying as a single long line.

Changes:
- Enable `wrap_help` feature in clap configuration
- Add `terminal_size` crate as dependency for detecting terminal dimensions
- Update help template to support wrapping with proper formatting
- Help snapshots now show wrapped text at 150 character column width
2025-12-09 17:09:56 -08:00
Maximilian Roos 67cfcd0f63 Add subdoc expansion for nested command documentation
Implements a system to include subcommand help as H2 sections within parent command docs pages using HTML comment placeholders.

In `cli.rs`, add `<!-- subdoc: subcommand-name -->` placeholders to a command's `after_long_help`. During `--help-page` generation, these expand to formatted sections with the subcommand's documentation and command reference.

The expansion process:
- Locates `<!-- subdoc: create -->` style placeholders
- Fetches the subcommand's help output via `get_help_reference()`
- Increases markdown heading levels (## → ###) so nested headings are children of the main H2
- Combines the subcommand's conceptual docs with a "Command reference" section
- Strips after_long_help from the help reference to avoid duplication

Also refactors help reference extraction into a reusable `get_help_reference()` function and adds `increase_heading_levels()` for proper nesting. Adds documentation in `CLAUDE.md` and expands `config.md` with full template content for `wt config create` and `wt config var` subcommands.
2025-12-09 15:35:35 -08:00
Maximilian Roos a0879623fc Distinguish same commit from ancestor in integration detection
Separate the "same commit" case (branch HEAD == main) from "ancestor"
case (branch is ancestor of main but main has moved past) to enable
distinct status symbols. Update symbol from `·` to `_` for clarity and
add `Ancestor` variant to `IntegrationReason` enum. Branches that are
ancestors now show `⊂` (integrated) instead of `_` (same commit).
2025-12-09 15:22:38 -08:00
Maximilian Roos edbf068d1e Update command page generation to use skeleton files with marker regions
Command pages now preserve frontmatter in skeleton files (title, weight, group)
and replace only the AUTO-GENERATED marker region during sync. The END tag
mirrors the source ID to unambiguously match regions even with nested markers.

This allows manual editing of frontmatter and conceptual docs while keeping
auto-generated content synchronized. The main.rs generator outputs just the
content between START and END markers, and the sync test uses regex to find
and replace the exact region.
2025-12-09 14:31:57 -08:00
Maximilian Roos 9e5b8820f2 Document default branch detection mechanism
Add FAQ entry explaining how Worktrunk determines the default branch,
including the three-step detection process (local cache, remote query,
local inference) and cache refresh guidance.

Expand the `wt config cache` help text with detailed explanation of each
detection step, network requirements, and caching behavior.
2025-12-09 14:28:42 -08:00
Maximilian Roos 236eae81f8 Redesign JSON output for wt list --format=json to be query-friendly
Restructure the JSON schema with flattened, self-describing fields organized
by concept (working_tree, branch_state, main, remote, worktree) instead of
nested status objects. This makes jq queries simpler and more intuitive.

- Flatten status object: branch_state, integration_reason, working_tree now
  at top level with boolean flags
- Rename fields for clarity: "Ahead" → ahead (numeric), "behind" → behind,
  "main_divergence" → main.ahead/behind
- Add new fields: commit (sha, short_sha, message, timestamp), kind
  (worktree/branch), symbols (raw status without colors), statusline
- Reorganize remote tracking data under remote.{name, branch, ahead, behind}
- Document all fields in comprehensive table with examples
- Update jq query examples in help text
2025-12-09 11:17:42 -08:00
Maximilian Roos c5a623d88e Improve documentation clarity and structure
Add subsection heading for CI status documentation to organize the list
command reference. Update homepage language for consistency and precision:
replace "creating one" with "creating a worktree", change "clunky" context
to "clunky UX", "complicated" to "verbose", and update section headings to
be more descriptive. Add reference to CI status section in next steps.
2025-12-09 11:12:32 -08:00
Maximilian Roos cbd414130f Simplify homepage hero section and prevent text wrapping
Remove unused fade-in animation and explore button. Prevent
"parallel AI agent workflows" from wrapping to new line with
nowrap style. Change call-to-action button text from "Get Started"
to "Learn More" for clarity.
2025-12-08 23:51:45 -08:00
Maximilian Roos c4f8070a28 Update worktree state symbols for clarity
Replace ⌫ (prunable) with ⊟ and ⊠ (locked) with ⊞ for better visual distinction and consistency across documentation, source code, and test snapshots.
2025-12-08 23:26:59 -08:00
Maximilian Roos 8483adec6e Update status symbols for improved clarity
Replaces four branch state symbols with more intuitive alternatives:
- ✖ → ✘ (merge conflicts)
- ↻ → ⤴ (rebase in progress)
- ⋈ → ⤵ (merge in progress)
- ⚔ → ✗ (would conflict if merged)

Updates symbol usage across documentation, code comments, rendering
logic, color formatting, and test snapshots.
2025-12-08 23:20:46 -08:00
Maximilian Roos e2a6f5e3b1 Add link to branch cleanup docs for content integrated symbol
The "⊂" symbol description now links to the branch cleanup section that explains when content is considered integrated and how to remove such branches.
2025-12-08 22:43:53 -08:00
Maximilian Roos 8bb22a4ee3 Reorder divergence symbols by priority in status documentation
The diverged symbol (↕ for main, ⇅ for remote) should appear before ahead/behind symbols in priority order, matching the actual display behavior where divergence takes precedence over directional indicators.
2025-12-08 22:42:42 -08:00
Maximilian Roos 03d5fd4fc9 docs: move hook command earlier in navigation for discoverability
Changed weight from 50 to 17 to reorder the hook command page earlier
in the documentation navigation, making it more accessible to users.
2025-12-08 22:16:24 -08:00
Maximilian Roos 6f3fe051d6 Clarify VHS fork setup and keystroke overlay calibration
Reorganize prerequisites and build instructions to make the custom VHS fork requirement more prominent. Expand explanation of why the fork is needed and how keystroke timing was calibrated through frame analysis. Add concrete steps for recalibration if needed.
2025-12-08 22:15:26 -08:00
Maximilian Roos 0275cf40be Release v0.1.16: squash-merge detection, CI caching, and docs
- Add squash-merge integration detection with improved branch cleanup
- Add CI absence caching to reduce rate limit consumption
- Add shell completion black-box snapshot tests
- Change merge conflict indicator from ⊘ to ⚔
- Document hook JSON context, CI caching, and status column details
2025-12-08 21:30:59 -08:00
Maximilian Roos 14e51c6747 docs: update select keybindings and sync auto-generated content
Update keybindings in select documentation to match actual behavior:
- Remove `j`/`k` navigation (up/down arrows only)
- Remove `q` as cancel option (Esc only)
- Change `/` filter to generic `(type)` to indicate typing
- Update `Alt+p` to `Alt-p` for consistency

Regenerate README and docs from latest sources to reflect these
keybinding changes and formatting improvements.
2025-12-08 21:11:05 -08:00
Maximilian Roos 85abc37b9b Improve alignment and spacing in list command output table
The table columns are now properly aligned with consistent spacing between
headers and data rows, making the output easier to scan and read.
2025-12-08 21:10:27 -08:00
Maximilian Roos e09da99e3a Update marketing copy and list output formatting
Refine language in the "Context: git worktrees" section to clarify that
git worktrees provide isolation for agents. Change "Claude and Codex" to
"Claude Code and Codex" and "are a great primitive for giving" to "provide
each agent with" for clearer phrasing.

Adjust the `wt list` example output to use single spaces between columns
instead of multiple spaces, and add a blank line between the main/feature-api
rows and the fix-auth row to improve visual separation in the terminal output.
2025-12-08 21:06:55 -08:00
Maximilian Roos 57210d6916 Fix tree comparison for branches without worktrees
When listing branches without worktrees, the tree identity check was
comparing against HEAD (the main worktree's HEAD) instead of the branch's
actual commit. Now uses the item's commit SHA to correctly determine if
the branch's tree matches the default branch's tree.

Updates documentation snapshots to reflect the removal of the merged-in
indicator (⊂) for branches that have been integrated, as the tree
comparison now correctly identifies them.
2025-12-08 19:24:27 -08:00
Maximilian Roos 6325be289b feat: add integration detection for squash-merged branches
Improve branch cleanup detection with four ordered checks to identify when
branch content is already in the target branch. This enables accurate removal
of squash-merged branches even after target advances.

**New integration checks (in cost order):**
- Same commit: Branch HEAD is literally the same commit as target
- No added changes: Three-dot diff shows no file changes beyond merge-base
- Tree contents match: Tree SHA equals target's tree SHA
- Merge simulation: Merging branch into target adds nothing (--full only)

**Status symbols updated:**
- `·` for same commit (cheapest check)
- `⊂` for content integrated via different history (all other cases)

Previously used `≡` (matches main) and `_` (no commits) which were ambiguous.
The new symbols better represent the checked conditions.

**Implementation:**
- Add `IsAncestorTask`, `HasFileChangesTask`, `WouldMergeAddTask` to task DAG
- Add `is_ancestor`, `has_file_changes`, `would_merge_add` fields to `ListItem`
- Create `IntegrationReason` enum for type-safe reason tracking
- Update `is_potentially_removable()` logic with ordered checks
- Refine `BranchOpState` variants to map to integration reasons
2025-12-08 18:50:40 -08:00
Maximilian Roos efc8c5ff04 Improve Python example for hook JSON context
Update variable name for clarity and add second print statement to demonstrate accessing hook metadata fields. Shows practical usage of `hook_type` and optional `hook_name` fields with fallback.
2025-12-08 18:44:06 -08:00
Maximilian Roos 1f9bb38fa8 Clarify Status column has subcolumns with priority ordering
The introductory sentence for the Status symbols section now explains that the Status column contains multiple subcolumns and that only the first matching symbol appears within each subcolumn, listed in priority order. This provides clearer context before the detailed symbol table.
2025-12-08 18:25:59 -08:00
Maximilian Roos 342090279a Improve clarity of git worktree context and UX explanation
Reorganize paragraphs in the "Context: git worktrees" section to better
explain the problem space. Break up dense sentences for readability and
emphasize that the core issue is clunky UX, not just the existence of
worktrees.

Changes apply to both README.md and docs/content/why-worktrunk.md.
2025-12-08 18:19:25 -08:00
Maximilian Roos af8058980b Document JSON context available to hooks on stdin
Hooks now receive repository context as JSON on standard input, allowing
them to be written in any language without relying on template variable
parsing. This section documents all available fields with examples and
use cases for Python, Node, and other languages.
2025-12-08 18:15:37 -08:00
Maximilian Roos ac3e27d5b9 Clarify working tree status symbols as subcolumns
The working tree status indicators (`+`, `!`, `?`) represent three
separate positions within the Status column rather than a single
category. Rename "Category" to "Subcolumn" and explicitly number each
working tree row to reflect this structure across documentation,
CLI help text, and test snapshots.
2025-12-08 18:06:47 -08:00
Maximilian Roos 89103a6da9 Reorganize status symbol categories for merge conflicts
The merge conflict symbol (✖) is moved from Working tree to Branch state category, while the would-conflict symbol (⚔) moves from Branch state to the empty category row. This better reflects that merge conflicts are a branch state condition rather than a working tree state.
2025-12-08 16:33:09 -08:00
Maximilian Roos 72a50803cf Clarify --full flag description for list command
Replace "line diffs" with "`main` diffstat" to more accurately describe what the flag displays when showing CI and upstream divergence information.
2025-12-08 16:24:09 -08:00
Maximilian Roos 4804913209 docs: document CI caching behavior and cache management
Add documentation explaining that CI results are cached for 30-60 seconds
and how to use `wt config cache` to view or clear the cache. This helps
users understand why CI status may appear stale and how to manage cached
results.
2025-12-08 16:13:16 -08:00
Maximilian Roos f3b96a8375 Replace merge conflict indicator with crossed swords symbol
Merge branch 'main' into conflicts to resolve integration issues
and update conflict visualization with more intuitive Unicode symbol.
2025-12-08 16:07:33 -08:00
Maximilian Roos d3845ba166 Replace merge-tree conflict indicator with crossed swords symbol
The merge-tree conflicts symbol changes from ⊘ to ⚔ across all
documentation, code, and test snapshots for better visual distinction
from the rebase symbol (↻).
2025-12-08 15:26:39 -08:00
Maximilian Roos 19460c188d Release 0.1.15 (#116)
* Release 0.1.15

Changelog:
- Add `wt hook` command for running lifecycle hooks directly
- Add named hook execution with `wt hook <type> <name>`
- Fix zsh completion _describe syntax
- Fix fish shell wrapper stderr redirection
- Fix CI status check for local branches without upstream
- Include executed git command in error messages

Also updated release documentation in FAQ.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Add merge-to-main step to release guidelines

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix update-homebrew.sh for binary releases

The formula now uses pre-built binaries per platform instead of source
tarballs. Updated script to:
- Download each platform binary (aarch64/x86_64 macOS, x86_64 Linux)
- Compute SHA256 for each
- Update version field, URLs, and sha256 values in formula

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix update-homebrew.sh for macOS bash 3.2 compatibility

Remove bash 4+ associative arrays to work with macOS default bash.
Use individual variables for each platform's SHA256 hash instead.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Simplify homebrew script and release instructions

update-homebrew.sh:
- Fetch pre-computed SHA256 from release .sha256 files instead of downloading binaries
- Reduced from 174 to 58 lines

Release instructions:
- Use `wt merge --no-remove` before tagging so release commit is on main
- Clearer step-by-step flow

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Simplify tag push in release instructions

wt merge already pushes main, so we only need to push the tag.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-08 14:59:07 -08:00
Maximilian Roos 6273ccdb64 Only check CI for branches with upstream tracking configured
Local-only branches now show blank CI status instead of potentially
matching unrelated remote branches with the same name. Updated
documentation and added validation to prevent false positives when
detecting PR/MR status.
2025-12-08 14:21:37 -08:00
Maximilian Roos a89047816e Add wt hook command for running lifecycle hooks (#113)
* Consolidate hook documentation into wt hook command

Move all lifecycle hook documentation from standalone hooks.md into the
wt hook --help output:

- Create `wt hook` command with subcommands for each hook type
  (post-create, post-start, pre-commit, pre-merge, post-merge, pre-remove)
- Move hook execution from `wt step` to `wt hook`
- Add comprehensive template variable documentation to --help
- Consolidate all hook reference content into single canonical location
- Delete docs/content/hooks.md, replace with generated hook.md
- Update all links from /hooks/ to /hook/

The `wt step` command now focuses purely on git operations (commit,
squash, rebase, push) while `wt hook` handles user-defined lifecycle
commands.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Update snapshot for clap's 'hook' suggestion on invalid command

* Fix hook command completion and test references

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-08 14:08:14 -08:00
Maximilian Roos 3a0a1404b3 Format file paths in backticks for consistent code styling
Updates documentation and help text to wrap file paths (`.config/wt.toml`, `~/.config/worktrunk/config.toml`) in backticks, matching the existing style for inline code references throughout the docs and CLI help output.
2025-12-08 13:50:52 -08:00
Maximilian Roos 3c971f0624 feat: pipe JSON context to hook stdin (#109)
* feat: pipe JSON context to hook stdin

Hooks now receive worktree context as JSON on stdin, enabling hooks
written in any language to access repo/branch/worktree information.

Changes:
- Foreground hooks (post-create, pre-merge, etc.) receive JSON via stdin
- Background hooks (post-start) receive JSON via printf pipe
- JSON includes hook_type and hook_name for self-aware hooks
- Optional fields are omitted when unavailable (not null)
- Windows uses PowerShell with proper escaping

Example hook:
```python
import json, sys
ctx = json.load(sys.stdin)
print(f"Setting up {ctx['repo']} on {ctx['branch']}")
```

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: add missing stdin_content parameter to Windows execute_streaming call

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-08 12:08:17 -08:00
Maximilian Roos 69474c620d Add --project flag to wt config create (#110)
Add `wt config create --project` to generate `.config/wt.toml` project
config files with documented examples. This makes it easier for users
to discover and create project configs.

Changes:
- Add --project flag to create project config instead of user config
- Show both user and project config templates in --help
- Update reference from dev/wt.example.toml to docs URL
- Add example to wt config --help

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-08 12:04:13 -08:00
Maximilian Roos 22698cf182 Add pre-remove hook for cleanup before worktree removal (#107)
Implement pre-remove hooks that run before `wt remove` deletes a worktree.
This allows cleanup tasks, state saving, or external notifications before
removal. Key features:

- FailFast strategy: non-zero exit code aborts removal (worktree preserved)
- Runs in both sync and background modes (before spawning background)
- All standard template variables available (branch, worktree, repo, etc.)
- Does not run for branch-only removal (no worktree)
- Skip with `--no-verify` flag
- Run manually with `wt step pre-remove`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-08 11:18:22 -08:00
Maximilian Roos cdccfd71c5 docs: improve grammar and clarity in why-worktrunk documentation
Refine wording for better readability and flow, including:
- Add comma after introductory clause for clarity
- Replace "But git worktrees' UX" with "But the UX" for conciseness
- Ensure consistent grammar throughout the document
2025-12-07 14:37:44 -08:00
Maximilian Roos 8bf3e947f8 Demo: lighter background, gold cursor and prompt
- Background: #FFF9E8 → #FFFDF8 (lighter, near-white)
- Cursor: #0969da (blue) → #d97706 (amber/gold)
- Prompt directory and character: blue/green → gold

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 23:24:18 -08:00