Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
Release 0.1.15 (#116)
Maximilian Roos19460c188dfb
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 2da2a1e5e..62a013763 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -2,6 +2,20 @@## Unreleased+## 0.1.15++### Added++- **`wt hook` command**: New command for running lifecycle hooks directly. Moved hook execution from `wt step` to `wt hook` for cleaner semantic separation. ([#113](https://github.com/max-sixty/worktrunk/pull/113))+- **Named hook execution**: Run specific named commands with `wt hook <type> <name>` (e.g., `wt hook pre-merge test`). Includes shell completion for hook names from project config. ([#114](https://github.com/max-sixty/worktrunk/pull/114))++### Fixed++- **Zsh completion syntax**: Fixed `_describe` syntax in zsh shell completions. ([6ae9d0f](https://github.com/max-sixty/worktrunk/commit/6ae9d0f9))+- **Fish shell wrapper**: Fixed stderr redirection in fish shell wrapper. ([0301d4b](https://github.com/max-sixty/worktrunk/commit/0301d4bf))+- **CI status for local branches**: Only check CI for branches with upstream tracking configured. ([6273ccd](https://github.com/max-sixty/worktrunk/commit/6273ccdb))+- **Git error messages**: Include executed git command in error messages for easier debugging. ([200eea4](https://github.com/max-sixty/worktrunk/commit/200eea43))+## 0.1.14### Addeddiff --git a/Cargo.lock b/Cargo.lockindex 74a8c9544..ec18a21f3 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -2933,7 +2933,7 @@ checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59"[[package]]name = "worktrunk"-version = "0.1.14"+version = "0.1.15"dependencies = ["ansi-str","ansi-to-html",diff --git a/Cargo.toml b/Cargo.tomlindex b94c61802..8dc8ca086 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -3,7 +3,7 @@ members = ["tests/helpers/setup-select-test", "tests/helpers/dev-detach"][package]name = "worktrunk"-version = "0.1.14"+version = "0.1.15"edition = "2024"rust-version = "1.89"build = "build.rs"diff --git a/dev/update-homebrew.sh b/dev/update-homebrew.shindex a7c9b3fac..99a6eb65b 100755--- a/dev/update-homebrew.sh+++ b/dev/update-homebrew.sh@@ -1,136 +1,57 @@#!/bin/bash-###############################################################################-# Update Homebrew Formula-###############################################################################-#-# Updates the homebrew-worktrunk formula with the current version from-# Cargo.toml. Downloads the release tarball and computes the SHA256 hash.-#-# Note: macOS only (uses BSD sed syntax).-#-# Prerequisites:-# - The version must already be released on GitHub (tag pushed)-# - The homebrew-worktrunk repo must be checked out as a sibling directory-#-# Usage:-# ./dev/update-homebrew.sh-#-# Automatically commits and pushes to homebrew-worktrunk.-#-###############################################################################-+# Update homebrew-worktrunk formula with current version from Cargo.toml.+# Fetches pre-computed SHA256 hashes from GitHub release assets.+# macOS only (BSD sed syntax). Requires sibling ../homebrew-worktrunk checkout.set -e-# Colors for output-GREEN='\033[0;32m'-YELLOW='\033[1;33m'-RED='\033[0;31m'-NC='\033[0m'--print_status() { echo -e "${GREEN}✓${NC} $1"; }-print_warning() { echo -e "${YELLOW}⚠${NC} $1"; }-print_error() { echo -e "${RED}✗${NC} $1"; }+GREEN='\033[0;32m'; RED='\033[0;31m'; NC='\033[0m'+ok() { echo -e "${GREEN}✓${NC} $1"; }+err() { echo -e "${RED}✗${NC} $1"; exit 1; }-# Get script directory and project rootSCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"HOMEBREW_REPO="$(cd "$PROJECT_ROOT/../homebrew-worktrunk" 2>/dev/null && pwd)" || true+FORMULA="$HOMEBREW_REPO/Formula/wt.rb"-echo "========================================"-echo "Update Homebrew Formula"-echo "========================================"-echo ""+[[ -f "$FORMULA" ]] || err "Formula not found. Clone homebrew-worktrunk as sibling directory."+git -C "$HOMEBREW_REPO" diff --quiet && git -C "$HOMEBREW_REPO" diff --cached --quiet || err "homebrew-worktrunk has uncommitted changes"-# Check homebrew repo exists-if [[ -z "$HOMEBREW_REPO" || ! -d "$HOMEBREW_REPO" ]]; then- print_error "homebrew-worktrunk repo not found at ../homebrew-worktrunk"- echo "Clone it first:"- echo " cd $(dirname "$PROJECT_ROOT")"- echo " git clone [email protected]:max-sixty/homebrew-worktrunk.git"- exit 1-fi--FORMULA_FILE="$HOMEBREW_REPO/Formula/wt.rb"-if [[ ! -f "$FORMULA_FILE" ]]; then- print_error "Formula file not found: $FORMULA_FILE"- exit 1-fi--# Check homebrew repo is clean-if ! git -C "$HOMEBREW_REPO" diff --quiet || ! git -C "$HOMEBREW_REPO" diff --cached --quiet; then- print_error "homebrew-worktrunk repo has uncommitted changes"- echo "Commit or stash changes first"- exit 1-fi--# Get version from Cargo.tomlVERSION=$(grep '^version = ' "$PROJECT_ROOT/Cargo.toml" | head -1 | sed 's/version = "\(.*\)"/\1/')-if [[ -z "$VERSION" ]]; then- print_error "Could not extract version from Cargo.toml"- exit 1-fi-if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then- print_error "Invalid version format: $VERSION (expected semver like 0.1.10)"- exit 1-fi-print_status "Current version: $VERSION"--# Check if tag exists on GitHub-TARBALL_URL="https://github.com/max-sixty/worktrunk/archive/refs/tags/v${VERSION}.tar.gz"-echo "Checking release exists..."-if ! curl --output /dev/null --silent --head --fail "$TARBALL_URL"; then- print_error "Release v${VERSION} not found on GitHub"- echo "Make sure you've pushed the tag:"- echo " cargo release patch --execute # or minor/major"- exit 1-fi-print_status "Release v${VERSION} found on GitHub"+[[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || err "Invalid version: $VERSION"+ok "Version: $VERSION"-# Download and compute SHA256-echo "Computing SHA256..."-TMPFILE=$(mktemp)-trap "rm -f $TMPFILE" EXIT-curl -sL "$TARBALL_URL" -o "$TMPFILE"-SHA256=$(shasum -a 256 "$TMPFILE" | cut -d' ' -f1)-print_status "SHA256: $SHA256"+BASE="https://github.com/max-sixty/worktrunk/releases/download/v${VERSION}"-# Update formula-echo "Updating formula..."+# Fetch pre-computed SHA256 from release assets (cargo-dist publishes .sha256 files)+fetch_sha() {+ local sha=$(curl -sfL "$BASE/worktrunk-$1.tar.xz.sha256" | cut -d' ' -f1)+ [[ ${#sha} -eq 64 ]] || err "Failed to fetch SHA256 for $1"+ echo "$sha"+}-# Update URL line (version pattern: digits and dots)-sed -i '' "s|url \"https://github.com/max-sixty/worktrunk/archive/refs/tags/v[0-9.]*\.tar\.gz\"|url \"$TARBALL_URL\"|" "$FORMULA_FILE"+SHA1=$(fetch_sha "aarch64-apple-darwin")+SHA2=$(fetch_sha "x86_64-apple-darwin")+SHA3=$(fetch_sha "x86_64-unknown-linux-musl")+ok "Fetched SHA256 hashes"-# Update sha256 line (64 hex characters)-sed -i '' "s|sha256 \"[a-f0-9]\{64\}\"|sha256 \"$SHA256\"|" "$FORMULA_FILE"+# Update formula: version, URLs, and SHA256 values (in order they appear)+sed -i '' "s|version \"[0-9.]*\"|version \"$VERSION\"|" "$FORMULA"+sed -i '' "s|/v[0-9.]*/worktrunk-|/v${VERSION}/worktrunk-|g" "$FORMULA"-# Verify updates succeeded-if ! grep -q "v${VERSION}" "$FORMULA_FILE"; then- print_error "Failed to update URL in formula"- exit 1-fi-if ! grep -q "$SHA256" "$FORMULA_FILE"; then- print_error "Failed to update SHA256 in formula"- exit 1-fi+TMPFILE=$(mktemp)+awk -v s1="$SHA1" -v s2="$SHA2" -v s3="$SHA3" '+/sha256 "[a-f0-9]{64}"/ { n++; gsub(/sha256 "[a-f0-9]{64}"/, "sha256 \"" (n==1?s1:n==2?s2:s3) "\"") }+{ print }' "$FORMULA" > "$TMPFILE" && mv "$TMPFILE" "$FORMULA"-print_status "Formula updated: $FORMULA_FILE"+grep -q "version \"${VERSION}\"" "$FORMULA" || err "Failed to update version"+ok "Formula updated"-# Commit and pushcd "$HOMEBREW_REPO"git add Formula/wt.rb-if git diff --cached --quiet; then- echo ""- echo "========================================"- print_status "Formula already up to date (v${VERSION})"- echo "========================================"+ ok "Already up to date (v${VERSION})"else- echo "Committing and pushing..."git commit -m "Update to v${VERSION}"git push- echo ""- echo "========================================"- print_status "Done! homebrew-worktrunk updated to v${VERSION}"- echo "Users can now run: brew upgrade wt"- echo "========================================"+ ok "Pushed v${VERSION} to homebrew-worktrunk"fidiff --git a/docs/content/faq.md b/docs/content/faq.mdindex 9728376c5..16d13a834 100644--- a/docs/content/faq.md+++ b/docs/content/faq.md@@ -132,9 +132,8 @@ $ cargo test --test integration --features shell-integration-tests### Releases-Use [cargo-release](https://github.com/crate-ci/cargo-release):--```bash-$ cargo release patch --execute # 0.1.0 -> 0.1.1-$ cargo release minor --execute # 0.1.0 -> 0.2.0-```+1. **Update the changelog**: Move items from `## Unreleased` to a new version section+2. **Bump version and commit**: Update `Cargo.toml` version, commit with "Release x.y.z"+3. **Merge to main**: `wt merge --no-remove` (squashes to main, keeps worktree for tagging)+4. **Tag and push**: `git tag vX.Y.Z main && git push origin vX.Y.Z`+5. **Update Homebrew**: After CI completes, run `./dev/update-homebrew.sh`