-
Notifications
You must be signed in to change notification settings - Fork 15
Description
I have a setup where I use Bridle to manage OpenCode configuration profiles. My configuration directory (~/.config/opencode) is managed through a dotfiles repository using stow.
Current situation:
- Bridle stores profiles in a dedicated directory (e.g., ~/.config/bridle/profiles/)
- Each profile contains OpenCode configuration
- ~/.config/opencode should point to the currently active profile
Symlink structure:
~/.config/ # stow symlinks → ~/jb-home/home/.config/
└── opencode/ # current active profile
├── config.json
└── ...
~/.config/bridle/profiles/ # profile storage (under git in jb-home)
├── default/
│ ├── config.json
│ └── ...
├── work/
│ ├── config.json
│ └── ...
└── personal/
├── config.json
└── ...
The problem:
-
When ~/.config/opencode is a regular directory under git control, every profile change results in git detecting changes and creating commits for the same files repeatedly.
-
When ~/.config/opencode is a symlink to the profile directory, Bridle's smart detection of config updates sees the symlink change and interprets this as the user having modified the configuration externally. It then deletes its own profile files when trying to sync, causing data loss.
Desired behavior:
When the OpenCode config directory is a symlink, Bridle should:
- Detect that it's a symlink
- Simply replace the symlink target when switching profiles
- Not attempt to sync or compare contents with the profile storage
- Keep the actual profile data safely stored in its profile directory
Proposed solution:
Add an option to enable "symlink mode" for config directories. When enabled:
- Bridle checks if the config directory is a symlink
- If so, instead of syncing/copying files, it just updates the symlink target
- This keeps git history clean (all changes happen in the profile storage directory)
- No risk of Bridle deleting profile data due to external changes
This would be useful for anyone using:
- Stow or similar dotfile managers
- Git-controlled configuration repositories
- A setup where the config directory needs to be shared or symlinked
Would this feature be feasible to implement? I'm happy to discuss further or contribute if guidance is provided.