Does sugar manage git branches and/or worktrees? #4
|
I just found this project and it looks like exactly what i've been looking for. I will have time to try it out myself in the next 1-2 days. In the meantime - just wondering how this extension managed git branching and/or worktrees? In either case - is it possible to have sugar in mutiple claude code sessions in the some git repo working on different sets of queues? |
Replies: 1 comment
|
Short answer: Sugar manages git branches (partially) but not worktrees. Running multiple Sugar sessions in one repo working directory at the same time is not safe. Worktrees: noSugar never calls Branches: only conditionally, and only for GitHub-sourced workSugar has two git workflow modes, set in config under
The branch creation ( Important detail: that Multiple sessions in the same repo: not with the current designThe git operations share a single working tree, and there is no file locking or mutex around them. Git's So for your "multiple Claude Code sessions on different queues in the same git repo" case, the safe setup today is:
The cleanest path if you want true concurrency on one repo is exactly what you guessed Sugar should be doing: create the worktrees yourself and run one Sugar process per worktree. Sugar will happily operate inside a worktree directory, it just will not create one for you. This is current as of the |
Short answer: Sugar manages git branches (partially) but not worktrees. Running multiple Sugar sessions in one repo working directory at the same time is not safe.
Worktrees: no
Sugar never calls
git worktree. There are zero references to worktrees anywhere in the codebase. All git operations run against the current working directory (cwd=self.repo_pathinGitOperations). So your assumption is correct: Sugar works on whatever repo you invoked it in. It does not spin up isolated worktrees.Branches: only conditionally, and only for GitHub-sourced work
Sugar has two git workflow modes, set in config under
sugar.discovery.github.workflow.git_workflow:direct_commit(default): Sugar does not …