-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
I recently had my lazygit config become deprecated. Specifically from this key path migration.
However my config file is a symlink to my /nix/store (it's managed by nix itself) so it's immutable. When I tried to open lazygit after this schema change, I only got this output to my shell:
2025/01/24 10:31:27 Couldn't write migrated config back to `/home/$USER/.config/lazygit/config.yml`: open /home/$USER/.config/lazygit/config.yml: read-only file system
which is not intuitive at all. I had to read the source code to finally find this snippet to explain why this happened:
// Write config back if changed
if string(changedContent) != string(content) {
if err := os.WriteFile(path, changedContent, 0o644); err != nil {
return nil, fmt.Errorf("Couldn't write migrated config back to `%s`: %s", path, err)
}
return changedContent, nil
}Describe the solution you'd like
I think lazygit should be telling the user that it's trying to rewrite my config file to self-heal it, especially if the os write leads to a failure.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request