wtcode 0.1.2__tar.gz → 0.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wtcode
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Launch your favorite code tool in a git worktree
5
5
  Author-email: Jaeho Shin <netj@sparcs.org>
6
6
  License-Expression: MIT
@@ -18,7 +18,7 @@ Dynamic: license-file
18
18
 
19
19
  # wtcode
20
20
 
21
- **Launch your favorite code tool in a git worktree.**
21
+ **Effortlessly launch your favorite code tool in a git worktree.**
22
22
 
23
23
  *worktree code* / *what-the-code* -- streamlines git worktree selection, creation, and launching tools like [Claude Code](https://claude.ai/code), [lazygit](https://github.com/jesseduffield/lazygit), your editor, or any command.
24
24
 
@@ -56,10 +56,13 @@ ln -s "$PWD/wtcode/wtcode.sh" /usr/local/bin/wtcode
56
56
 
57
57
  ```
58
58
  wtcode [BRANCH] [CMD [CMD-ARGS...]]
59
+ wtcode --exec CMD [CMD-ARGS...]
59
60
  ```
60
61
 
61
62
  - **`BRANCH`** -- Git branch or worktree name. If omitted and [fzf](https://github.com/junegunn/fzf) is available, interactively select one. Prefix with `:` to create a new branch (use `:::name` to avoid fzf matching the colons).
62
63
  - **`CMD`** -- Command to launch in the worktree. Defaults to `$WTCODE_CMD`, or the first available of: `claude`, `aider`, `codex`, `$SHELL`.
64
+ - **`--exec`** -- Skip the branch argument; select interactively via fzf, then launch `CMD`.
65
+ - **`--help`** / **`--version`** -- Show help or version info.
63
66
 
64
67
  ### Examples
65
68
 
@@ -67,6 +70,7 @@ wtcode [BRANCH] [CMD [CMD-ARGS...]]
67
70
  wtcode feature-x # launch default tool in feature-x worktree
68
71
  wtcode feature-x lazygit # launch lazygit
69
72
  wtcode feature-x claude --resume # launch claude with flags
73
+ wtcode --exec claude --resume # select interactively, launch claude --resume
70
74
  wtcode :new-feature # create new branch and worktree
71
75
  wtcode # interactive branch selection via fzf
72
76
  WTCODE_CMD=cursor wtcode feature # use cursor as default tool
@@ -1,6 +1,6 @@
1
1
  # wtcode
2
2
 
3
- **Launch your favorite code tool in a git worktree.**
3
+ **Effortlessly launch your favorite code tool in a git worktree.**
4
4
 
5
5
  *worktree code* / *what-the-code* -- streamlines git worktree selection, creation, and launching tools like [Claude Code](https://claude.ai/code), [lazygit](https://github.com/jesseduffield/lazygit), your editor, or any command.
6
6
 
@@ -38,10 +38,13 @@ ln -s "$PWD/wtcode/wtcode.sh" /usr/local/bin/wtcode
38
38
 
39
39
  ```
40
40
  wtcode [BRANCH] [CMD [CMD-ARGS...]]
41
+ wtcode --exec CMD [CMD-ARGS...]
41
42
  ```
42
43
 
43
44
  - **`BRANCH`** -- Git branch or worktree name. If omitted and [fzf](https://github.com/junegunn/fzf) is available, interactively select one. Prefix with `:` to create a new branch (use `:::name` to avoid fzf matching the colons).
44
45
  - **`CMD`** -- Command to launch in the worktree. Defaults to `$WTCODE_CMD`, or the first available of: `claude`, `aider`, `codex`, `$SHELL`.
46
+ - **`--exec`** -- Skip the branch argument; select interactively via fzf, then launch `CMD`.
47
+ - **`--help`** / **`--version`** -- Show help or version info.
45
48
 
46
49
  ### Examples
47
50
 
@@ -49,6 +52,7 @@ wtcode [BRANCH] [CMD [CMD-ARGS...]]
49
52
  wtcode feature-x # launch default tool in feature-x worktree
50
53
  wtcode feature-x lazygit # launch lazygit
51
54
  wtcode feature-x claude --resume # launch claude with flags
55
+ wtcode --exec claude --resume # select interactively, launch claude --resume
52
56
  wtcode :new-feature # create new branch and worktree
53
57
  wtcode # interactive branch selection via fzf
54
58
  WTCODE_CMD=cursor wtcode feature # use cursor as default tool
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "wtcode"
7
- version = "0.1.2"
7
+ version = "0.1.3"
8
8
  description = "Launch your favorite code tool in a git worktree"
9
9
  license = "MIT"
10
10
  readme = "README.md"
@@ -1,3 +1,3 @@
1
1
  """wtcode -- launch your favorite code tool in a git worktree."""
2
2
 
3
- __version__ = "0.1.2"
3
+ __version__ = "0.1.3"
@@ -8,8 +8,15 @@ shopt -s extglob
8
8
  ${WTCODE_DEBUG:+set -x}
9
9
 
10
10
  --msg() { echo "wtcode: $*" >&2; }
11
+ --sanitize-branch-name() {
12
+ printf '%s' "$1" |
13
+ tr '[:upper:]' '[:lower:]' | # lowercase
14
+ sed 's/[^a-z0-9/_-]/-/g' | # replace non-alnum to hyphens
15
+ sed 's/--*/-/g' | # collapse consecutive hyphens
16
+ sed 's/^-//; s/-$//' # trim leading/trailing hyphens
17
+ }
11
18
 
12
- WTCODE_VERSION=0.1.2
19
+ WTCODE_VERSION=0.1.3
13
20
  --version() { echo "wtcode $WTCODE_VERSION"; }
14
21
  --help() {
15
22
  cat <<USAGE
@@ -127,13 +134,12 @@ WTCODE_CMDS_TO_TRY=(
127
134
  force_new_branch=true
128
135
  branch_name=${branch_name##+(:)}
129
136
  : ${branch_name:?non-empty branch name required after ':'}
130
- # sanitize free-form text into a valid git branch name
131
- branch_name=$(printf '%s' "$branch_name" |
132
- tr '[:upper:]' '[:lower:]' | # lowercase
133
- sed 's/[^a-z0-9/_-]/-/g' | # replace non-alnum to hyphens
134
- sed 's/--*/-/g' | # collapse consecutive hyphens
135
- sed 's/^-//; s/-$//' # trim leading/trailing hyphens
136
- )
137
+ fi
138
+
139
+ # sanitize free-form text into a valid git branch name
140
+ # (skip if it already matches an existing branch/ref to preserve case)
141
+ if $force_new_branch || ! git rev-parse --verify "$branch_name" &>/dev/null; then
142
+ branch_name=$(--sanitize-branch-name "$branch_name")
137
143
  : ${branch_name:?branch name is empty after sanitization}
138
144
  fi
139
145
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wtcode
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Launch your favorite code tool in a git worktree
5
5
  Author-email: Jaeho Shin <netj@sparcs.org>
6
6
  License-Expression: MIT
@@ -18,7 +18,7 @@ Dynamic: license-file
18
18
 
19
19
  # wtcode
20
20
 
21
- **Launch your favorite code tool in a git worktree.**
21
+ **Effortlessly launch your favorite code tool in a git worktree.**
22
22
 
23
23
  *worktree code* / *what-the-code* -- streamlines git worktree selection, creation, and launching tools like [Claude Code](https://claude.ai/code), [lazygit](https://github.com/jesseduffield/lazygit), your editor, or any command.
24
24
 
@@ -56,10 +56,13 @@ ln -s "$PWD/wtcode/wtcode.sh" /usr/local/bin/wtcode
56
56
 
57
57
  ```
58
58
  wtcode [BRANCH] [CMD [CMD-ARGS...]]
59
+ wtcode --exec CMD [CMD-ARGS...]
59
60
  ```
60
61
 
61
62
  - **`BRANCH`** -- Git branch or worktree name. If omitted and [fzf](https://github.com/junegunn/fzf) is available, interactively select one. Prefix with `:` to create a new branch (use `:::name` to avoid fzf matching the colons).
62
63
  - **`CMD`** -- Command to launch in the worktree. Defaults to `$WTCODE_CMD`, or the first available of: `claude`, `aider`, `codex`, `$SHELL`.
64
+ - **`--exec`** -- Skip the branch argument; select interactively via fzf, then launch `CMD`.
65
+ - **`--help`** / **`--version`** -- Show help or version info.
63
66
 
64
67
  ### Examples
65
68
 
@@ -67,6 +70,7 @@ wtcode [BRANCH] [CMD [CMD-ARGS...]]
67
70
  wtcode feature-x # launch default tool in feature-x worktree
68
71
  wtcode feature-x lazygit # launch lazygit
69
72
  wtcode feature-x claude --resume # launch claude with flags
73
+ wtcode --exec claude --resume # select interactively, launch claude --resume
70
74
  wtcode :new-feature # create new branch and worktree
71
75
  wtcode # interactive branch selection via fzf
72
76
  WTCODE_CMD=cursor wtcode feature # use cursor as default tool
File without changes
File without changes
File without changes