Is there a reason `gt create` doesn’t have a `--pa...
# ideas
t
Is there a reason
gt create
doesn’t have a
--parent
flag? I feel this could be useful for scripting.
➕ 2
✅ 1
p
Digging into this, and it looks like it can cause some collisions with GitHub Worktrees. I'll log as a feature request, though!
t
Intriguing because the reason I’m asking is that I’m my Claude to use worktrees! I’d be very interested in learning about the best ways to use graphite with work trees
p
I don't have anything to share currently, but it's something we're working on!
🙏 1
s
@Tyler Laprade I've found the best approach is to keep root repo or a spare worktree for these operations, or to have your script create and discard one temporarily. Alternatively you can switch to the worktree of the parent branch in your script and create from there. Bit hacky but inference is cheap
❤️ 1
I've built up a decent worktree implementation with graphite and I'm happy to share so hmu if you want to discuss
❤️ 1
t
Very interesting @Sean! My Claude did suggest that at one point, but I didn’t like having to stay off of
trunk
. After banging my head against the problem all day yesterday I ended up with this (scripted) workflow that has been working well: 1. Manually open a new tab (doesn’t matter which worktree I start from) 2. Call my
new_workspace
shell function with a PR number, branch name, or just unescaped text that I want to prompt Claude with 3. The function intelligently creates a new worktree or `cd`’s to an existing worktree that is already on the desired branch, if applicable 4. The function attempts
gt get
in case the PR/branch already exists 5. If not, it will create a new branch and track it against
trunk
6. If a new worktree was created,
cd
into it (this is the only reason it’s a shell function rather than a script) 7. If the function was not called with a PR/branch, send all the args as the initial prompt to Claude
s
How's it going? I have my implementation to the point where with a few more tweaks it should be spec in > completed mergeable stack out
t
I’m pretty much there too. I feel like I’m flying with my workspace script removing all friction to starting new work, and I have a
/swarm
skill with parallel branches, UI verification, CI monitoring etc. that I use for most tasks