Re: [PATCH v2 0/4] worktree: add lifecycle hooks
"<Alexander G. Riccio>" <[email protected]>
| Newsgroups | org.kernel.vger.git |
|---|---|
| Message-ID | <CAN3N+zmzKBt75Gue--FbGWDxFY7HKfmRXX6O0FmtMRNyEfCjog@mail.gmail.com> |
(Apologies for replying out of thread -- I have never commented on the git mailing list before, and I found this discussion in the archive while looking into options for my own worktree hook needs) I have a concrete example of a motivating workflow, indeed using agentic development and proliferous worktrees. I figure it's worth writing in to add support for this - I'm sure I'm not the only one out there bumping into this problem in this current era, but git developers can only know about it if we volunteer the information! For me, I have disk space issues that relate from the interaction of XCode derived data and worktrees. It apparently uses the absolute path of the worktree for the per-project build state cache by default, and of course it by default stores a lot of this data out-of-worktree. I think I can change this configuration, but it's worth also noting that about a half dozen other related tools do similar things, and none of them have any way to know when the concomitant worktree is removed or pruned. When I remove a worktree manually, I already have a dedicated shell script to do cleanup like this, my script does a lot of very useful things when it gets used!! The root problem remains, that we cannot reliably count on agents to remember to do things we tell them to do. Currently, this means many gigabytes need to be cleaned up manually or agentically every day, which is annoying, time consuming, and wastes SSD writes. Sadly, it seems like none of the third party tools will emit events when someone or some-thing calls `git worktree remove` or `git worktree prune`, so there's no solid way to implement this outside native hooks expansions. Sincerely, Alexander Riccio -- "Change the world or go home." If left to my own devices, I will build more.