I don't get spending all this time on tooling that tries to ease working with worktrees when they're just not the right abstraction for the way we're working now.
I don't get spending all this time on tooling that tries to ease working with worktrees when they're just not the right abstraction for the way we're working now.
You use your filesystem ability to perform a snapshot of your local git repo? Or you do a cp -reflink?
How do you handle the exposure of secrets to agents?
One thing I like about worktrees is that you get a clean copy (with share git objects though), so you have to copy over what the agent will need, not remove what you don’t want the agent to see.
But yeah the filesystem cost is not ideal. I was just thinking about how to exclude my worktrees from timemachine backups automatically.
[1] https://lore.kernel.org/git/7c8b4673-37ac-45fa-ad8c-a1dc09af...
cp -R --reflink=always /path/to/source /path/to/dest
On macOS with APFS: cp -R -c /path/to/source /path/to/dest
That's it. You get a copy that only stores additional space for metadata, not the files themselves. NAME
clonefile – create copy on write clones of files
SYNOPSIS
...
LIMITATIONS
Cloning directories with these functions is strongly discouraged. Use copyfile(3) to clone directories instead.
But no explanation of why strongly discouraged.Also, it’s not really CoW. The immutable object store is hardlinked (since it’s immutable it doesn’t really CoW, but that’s not a very important distinction). But working files are full copies, and so is the rest of .git. With a CoW filesystem you can CoW everything, including node_modules and build artifacts.