lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

lazygit cannot be opened with read-only config files

Open myamusashi opened this issue 1 year ago • 2 comments

Describe the bug lazygit refuse to open because the file is read-only

To Reproduce Steps to reproduce the behavior:

  1. Use home-manager module to configure lazygit and generate files

Expected behavior lazygit must be open.

Screenshots Image

Version info: commit=, build date=, build source=nix, version=0.47.2, os=linux, arch=amd64, git version=2.48.1 git version 2.48.1

Additional context Add any other context about the problem here.

Note: please try updating to the latest version or manually building the latest master to see if the issue still occurs.

myamusashi avatar Feb 28 '25 00:02 myamusashi

The behavior you are noticing here is likely because you have some deprecated config. I can't say precisely what it is, but given the version is probably the change of the git.commitPrefix and git.commitPrefixes.<repo-name> from an yaml mapping to a sequence. See the Config.MD changes in https://github.com/jesseduffield/lazygit/pull/4261 for precise details.

See https://github.com/jesseduffield/lazygit/issues/4194#issuecomment-2650047783 for some discussion about why we prefer migrating config versus allowing multiple schemas. It ties into how we auto-generate the schema, and would like to keep that simple.

So if you just manually make those migrations, the message Provided user config is deprecated but auto-fixable will go away.

If this isn't the case, can you share the config file that is causing lazygit to think it needs to do an auto-migration?

ChrisMcD1 avatar Feb 28 '25 00:02 ChrisMcD1

Remove

commitPrefix = {
  pattern = "";
  replace = "";
};

fix the issue. Thanks for the quick response

myamusashi avatar Feb 28 '25 01:02 myamusashi