You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Store each stack in its own file so commands on different stacks do not share one lock #644
v0.3.0 has the same cause as #568. gh-stack keeps all stacks in a clone in one file, gh-stack, in the Git common directory. Every command that changes any stack must read and write that one file, so every command must take the same lock. The single file is the bottleneck: two commands for unrelated stacks in different worktrees cannot run at the same time.
Proposal
Replace the single file with a directory that has one file for each stack:
A command reads and writes only the file of its own stack. Commands on different stacks touch different files, so they do not need a shared lock.
To list all stacks, read the directory.
To create a stack, add a new file. To delete a stack, delete its file.
Write each file atomically (write to a temporary file, then rename it).
Keep the stop-and-continue rebase state in one file for each stack too, so a stopped rebase in one worktree does not block other stacks.
Only two commands on the same stack can still conflict, which is the expected behavior.
This is the same solution as for a registry kept in one shared file in a repository. Separate changes to different entries cause merge conflicts in one file, but no conflicts when each entry has its own file. Here the lock has the same role that the merge conflict has there.
Activity